Subject:
|
Re: BrickDraw3D bleeda
|
Newsgroups:
|
lugnet.cad.dev.mac
|
Date:
|
Thu, 12 Sep 2002 21:08:55 GMT
|
Viewed:
|
1878 times
|
| |
| |
In lugnet.cad.dev.mac, Don Heyse writes:
> Gotta love those trusty old C string processing functions. Actually
> I really wish you could do a strtok() for whitespace inside of a
> strtok() for newlines.
I bit the bullet and created a 'string' object for every line recently.
> > I must write a separate class that tries to parse sensible results out of a
> > hunk of text
>
> A class eh? What, are you purposely making it harder for me to borrow
> your code? The whole point of the challenge is to get you to write
> the code for me...
yeah, just to parse a line of DAT takes multiple inheritance now. AND there
is a weird "result" class you must supply with methods MakeComment,
MakeLine, MakeSubPart, etc. in order to link at all. After parsing, the
model or part is retrieved from the result object. (There are 2 classes of
result object: one which makes a part with optimized geometry, another makes
a collection of pieces.)
I think I will subclass CDATLine and call it "CPeeronLine", that way
everything can just work together... you could even save the file back out
in Peeron format (wow that's too weird) and open Peeron files with the same
"Open" command...
Or one class with mode flags... this class would be able to convert any type
of text into a sensible piece, and save itself later as DAT, and at least
export itself to Peeron format.
Actually my file export are implemented with a subclass of PieceFunctor that
visits all the pieces in the model. (Supporting 3DMF currently but DXF later
on.)
It's possible that if I slim down the "result" class into a small set of
methods, the parsing code from BrickDraw3D will be easily separable
(provided you like STL and multiple inheritance.)
|
|
Message is in Reply To:
| | Re: BrickDraw3D bleeda
|
| (...) Hopefully this is a more sensible challange than some of the causes I've adopted. DOS versions? What was I thinking? Every now and then I still have to fight the urge to waste more time on that one. (...) Gotta love those trusty old C string (...) (22 years ago, 12-Sep-02, to lugnet.cad.dev.mac)
|
8 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|