79 // Index (i.e. line number) of this object |
79 // Index (i.e. line number) of this object |
80 long getIndex (OpenFile* pFile); |
80 long getIndex (OpenFile* pFile); |
81 |
81 |
82 // Color used by this object. Comments, gibberish and empty entries |
82 // Color used by this object. Comments, gibberish and empty entries |
83 // do not use this field. |
83 // do not use this field. |
84 short dColor; |
84 short color; |
85 |
85 |
86 // OpenGL list for this object |
86 // OpenGL list for this object |
87 uint glLists[3]; |
87 uint glLists[3]; |
88 |
88 |
89 // Vertices of this object |
89 // Vertices of this object |
90 vertex vaCoords[4]; |
90 vertex coords[4]; |
91 |
91 |
92 // Object this object was referenced from, if any |
92 // Object this object was referenced from, if any |
93 LDObject* parent; |
93 LDObject* parent; |
94 |
94 |
95 // Type enumerator of this object |
95 // Type enumerator of this object |
113 |
113 |
114 // Swap this object with another. |
114 // Swap this object with another. |
115 void swap (LDObject* other); |
115 void swap (LDObject* other); |
116 |
116 |
117 // Moves this object using the given vertex as a movement vector |
117 // Moves this object using the given vertex as a movement vector |
118 virtual void move (vertex vVector); |
118 virtual void move (vertex vect); |
119 |
119 |
120 // What object in the current file ultimately references this? |
120 // What object in the current file ultimately references this? |
121 LDObject* topLevelParent (); |
121 LDObject* topLevelParent (); |
122 |
122 |
123 // Number of vertices this object has |
123 // Number of vertices this object has |
239 public: |
239 public: |
240 IMPLEMENT_LDTYPE (Subfile, 0) |
240 IMPLEMENT_LDTYPE (Subfile, 0) |
241 LDOBJ_COLORED |
241 LDOBJ_COLORED |
242 LDOBJ_SCHEMANTIC |
242 LDOBJ_SCHEMANTIC |
243 |
243 |
244 vertex vPosition; // Position of the subpart (FIXME: should get rid of this) |
244 vertex pos; // Position of the subpart (TODO: should get rid of this) |
245 matrix<3> mMatrix; // Transformation matrix for the subpart |
245 matrix<3> transform; // Transformation matrix for the subpart |
246 str zFileName; // Filename of the subpart |
246 str fileName; // Filename of the subpart (TODO: rid this too - use fileInfo->fileName instead) |
247 OpenFile* pFile; // Pointer to opened file for this subfile. null if unopened. |
247 OpenFile* fileInfo; // Pointer to opened file for this subfile. null if unopened. |
248 |
248 |
249 // Inlines this subfile. Note that return type is an array of heap-allocated |
249 // Inlines this subfile. Note that return type is an array of heap-allocated |
250 // LDObject-clones, they must be deleted one way or another. |
250 // LDObject-clones, they must be deleted one way or another. |
251 std::vector<LDObject*> inlineContents (bool bDeepInline, bool bCache); |
251 std::vector<LDObject*> inlineContents (bool deep, bool cache); |
252 }; |
252 }; |
253 |
253 |
254 // ============================================================================= |
254 // ============================================================================= |
255 // LDLine |
255 // LDLine |
256 // |
256 // |
324 // with. Vertices are a part authoring tool and they should not appear in |
324 // with. Vertices are a part authoring tool and they should not appear in |
325 // finished parts. |
325 // finished parts. |
326 // ============================================================================= |
326 // ============================================================================= |
327 class LDVertex : public LDObject { |
327 class LDVertex : public LDObject { |
328 public: |
328 public: |
329 IMPLEMENT_LDTYPE (Vertex, 0) // TODO: move vPosition to vaCoords[0] |
329 IMPLEMENT_LDTYPE (Vertex, 0) // TODO: move pos to vaCoords[0] |
330 LDOBJ_COLORED |
330 LDOBJ_COLORED |
331 LDOBJ_NON_SCHEMANTIC |
331 LDOBJ_NON_SCHEMANTIC |
332 |
332 |
333 vertex vPosition; |
333 vertex pos; |
334 }; |
334 }; |
335 |
335 |
336 // ============================================================================= |
336 // ============================================================================= |
337 // LDRadial |
337 // LDRadial |
338 // |
338 // |
356 |
356 |
357 IMPLEMENT_LDTYPE (Radial, 0) |
357 IMPLEMENT_LDTYPE (Radial, 0) |
358 LDOBJ_COLORED |
358 LDOBJ_COLORED |
359 LDOBJ_SCHEMANTIC |
359 LDOBJ_SCHEMANTIC |
360 |
360 |
361 LDRadial::Type eRadialType; |
361 LDRadial::Type radType; |
362 vertex vPosition; |
362 vertex pos; |
363 matrix<3> mMatrix; |
363 matrix<3> transform; |
364 short dDivisions, dSegments, dRingNum; |
364 short divs, segs, ringNum; |
365 |
365 |
366 LDRadial (LDRadial::Type eRadialType, vertex vPosition, matrix<3> mMatrix, |
366 LDRadial (LDRadial::Type radType, vertex pos, matrix<3> transform, short divs, short segs, short ringNum) : |
367 short dDivisions, short dSegments, short dRingNum) : |
367 radType (radType), pos (pos), transform (transform), divs (divs), segs (segs), ringNum (ringNum) {} |
368 eRadialType (eRadialType), vPosition (vPosition), mMatrix (mMatrix), |
|
369 dDivisions (dDivisions), dSegments (dSegments), dRingNum (dRingNum) {} |
|
370 |
368 |
371 // Returns a set of objects that provide the equivalent of this radial. |
369 // Returns a set of objects that provide the equivalent of this radial. |
372 // Note: objects are heap-allocated. |
370 // Note: objects are heap-allocated. |
373 std::vector<LDObject*> decompose (bool bTransform); |
371 std::vector<LDObject*> decompose (bool applyTransform); |
374 |
372 |
375 // Compose a file name for this radial. |
373 // Compose a file name for this radial. |
376 str makeFileName (); |
374 str makeFileName (); |
377 |
375 |
378 char const* radialTypeName (); |
376 char const* radialTypeName (); |
379 static char const* radialTypeName (const LDRadial::Type eType); |
377 static char const* radialTypeName (const LDRadial::Type type); |
380 }; |
378 }; |
381 |
379 |
382 // ============================================================================= |
380 // ============================================================================= |
383 // Object type names. Pass the return value of getType as the index to get a |
381 // Object type names. Pass the return value of getType as the index to get a |
384 // string representation of the object's type. |
382 // string representation of the object's type. |