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 / 2882
2881  |  2883
Subject: 
Re: DAT format question
Newsgroups: 
lugnet.cad.dev
Date: 
Wed, 22 Sep 1999 16:26:05 GMT
Viewed: 
369 times
  
On Tue, 21 Sep 1999 22:59:46 GMT, "Gary Williams" <graywolf@pcpros.net>
wrote:

However, it seems that any type of file can be stored in any of the usual
suite of directories, and the program is supposed to allow this to be
compatible with the other CAD packages.  This means that the parser will
have to be able to somehow analyze the contents of a file to determine what
kind of object it contains.  I think it's unfortunate that James Jessiman
didn't assign different extensions to each object type...like .prj for a
project (model), .prt for a part, and .pri for a primitive (they could
easily all have the same internal format--the extension would only be an aid
in identifying the contents).

I think it's too much of a kludge to make the parser into a two-pass loop,
and try to reverse-engineer all the references...but I'm at a loss to think
of a better way.

The only other alternative I can think of would to have sub-menus on the
File/Open and File/New menus, one for each file type.  Then it would be up
to the user to tell the program what type of file he was about to work with.

Thoughts?

For new files, LDAO allows the user to specify the type of the file,
separate from its location.  The type information is written to the file as
part of the header lines.  When a file is loaded, LDAO looks for the typing
information.  If the file doesn't have the typing tags, LDAO assumes the
type, based on the file's location.

So first, LDAO looks for a line in the file which starts:

0 Official xxxxxxx
or
0 Unofficial xxxxxxx

Where xxxxxxx is the file-type: Model, Part (or Element), Primitive,
Sub-part, or Sub-model.

If no such comment is found, LDAO assumes the type:
ldraw\models  -> Model
ldraw\p       -> Primitive
ldraw\parts   -> Part
ldraw\parts\s -> Sub-part
Other location-> Model

Also, if the file's descriptive name (in the first line in the DAT) starts
with a tilde, LDAO assumes the file is either a sub-model or sub-part.

Steve



Message is in Reply To:
  Re: DAT format question
 
My original plans called for my CAD package to distinguish among the various kinds of DAT file. This would allow the program to know when it was appropriate to enable certain editing features. For example, it shouldn't allow the user to add (...) (25 years ago, 21-Sep-99, to lugnet.cad.dev)

27 Messages in This Thread:













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

Custom Search

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