To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 6870
6869  |  6871
Subject: 
Re: A comprehensive LDraw object model
Newsgroups: 
lugnet.cad.dev
Date: 
Sun, 10 Feb 2002 01:02:25 GMT
Viewed: 
495 times
  
Sproaticus wrote:

In lugnet.cad.dev, Jeremy H. Sproat writes:

If the LDraw community can pool their efforts into providing at least an
object model for LDraw parts and functionality,


Here's my first contribution, a rough outline of a class structure.

*** LDRAW LINE TYPE CLASSES ***

abstract class LineType - ancestor class for all line-type objects

+ class LineType0 - comment line-type

  + class LineTypeCommand - command line-type


Aren't all of these classes Abstract? I mean this is only a
template for implementing a Class Library right? Are you planning
on actually filling in the code also? or just defining the
interfaces?


+ abstract class PhysicalLineType - ancestor class for all physically
mutable line-types

  + class LineType1 - subpart line-type

  + abstract class PrimitiveLineType - ancestor class for all
line-segment-containing line-types


So far you've got a few more levels in here than I used in my
class hierarchy. Until more of the interface is laid out, though
we won't really be able to tell if the extra layers provide value.


    + class LineType2 - line segment line-type

    + class LineType3 - triangle line-type

    + class LineType4 - quad line-type

    + class LineType5 - optional line segment line-type

+ class LineTypeNull - blank line-type



Well, do you need a Class for blank lines? Shouldn't the loader or
parser just ignore them?


*** LDRAW DAT MANAGEMENT CLASSES ***

class ColorManager

class LDrawFile - a container for LineType objects, represents a single datfile

+ class LDrawFileMulti - a container for LDrawFile objects, represents an
MPD file

abstract class ModelLoader - ancestor class for all model loaders, model cache

+ class DiskModelLoader - loads datfiles from local storage

+ class HTTPModelLoader - loads datfiles from web repository


There really shouldn't be much difference betweenn these should there?
It seems to me if you had one routine that read from a Stream, then you
could implement both of those as a wrapper easily enough.



class ModelParser - parses a datfile into its component LineType objects


This is an interesting idea. Maybe I'm not thinking about this right,
but what would a separate parser do that the loader didn't already do?

Or if you leave the work up to the Parser, what does the loader do?

What does it read the data into?


*** LDRAW DAT RENDERER CLASSES ***

abstract class LDrawRenderer - ancestor class for renderers

+ class LDrawRendererOrthographic - renders LDraw.exe style

*** MATH CLASSES ***


I'm not married to Java or Java3D, but it seems to me that
most languages must have a good Matix/Vendor Math Library
already, Do we need to redefine this? I would think this
would be one of the thing Computer Science has already beat
to death. No?


The big question that comes into my mind when thinking
about things like this is: "How closely do we model this on
LDraw?" What I mean, is that while the file format is useful
and we need to handel it, I'm not sure that programs written
in the future will want to be locked into using the same data
structures internally as the are used in the file.

It'll be useful to have a Parser class, and Objects for it
to dump the dat into, but I think those should be pretty well
decoupled from the render. (actually I wonder if defining a
renderer is worth it at all if we're not going to fill it
with real code.) Programs need to be able to tweak, massage,
and do whatever they want with the primitives inorder to
optimize the capabilites of their program. I would think
Authors this will lead Authors to want to do things in the
renders that might be limited by any render interface we
might come up with.

What do you think?

-Kyle



Message has 1 Reply:
  Re: A comprehensive LDraw object model
 
(...) The base class is abstract, the ones not marked "abstract" aren't. This class hierarchy is actually the class library I whipped up over the past week. About 95% of what I posted here has working code, but I didn't want to push any of that if (...) (23 years ago, 10-Feb-02, to lugnet.cad.dev)

Message is in Reply To:
  Re: A comprehensive LDraw object model
 
(...) Here's my first contribution, a rough outline of a class structure. *** LDRAW LINE TYPE CLASSES *** abstract class LineType - ancestor class for all line-type objects + class LineType0 - comment line-type + class LineTypeCommand - command (...) (23 years ago, 9-Feb-02, to lugnet.cad.dev)

30 Messages in This Thread:











Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR