112 str LDComment::getContents () { |
112 str LDComment::getContents () { |
113 return format ("0 %s", zText.chars ()); |
113 return format ("0 %s", zText.chars ()); |
114 } |
114 } |
115 |
115 |
116 str LDSubfile::getContents () { |
116 str LDSubfile::getContents () { |
117 str val = format ("1 %d %s ", dColor, vPosition.getStringRep (false).chars ()); |
117 str val = format ("1 %d %s ", dColor, vPosition.stringRep (false).chars ()); |
118 val += mMatrix.getStringRep (); |
118 val += mMatrix.stringRep (); |
119 val += ' '; |
119 val += ' '; |
120 val += zFileName; |
120 val += zFileName; |
121 return val; |
121 return val; |
122 } |
122 } |
123 |
123 |
124 str LDLine::getContents () { |
124 str LDLine::getContents () { |
125 str val = format ("2 %d", dColor); |
125 str val = format ("2 %d", dColor); |
126 |
126 |
127 for (ushort i = 0; i < 2; ++i) |
127 for (ushort i = 0; i < 2; ++i) |
128 val.appendformat (" %s", vaCoords[i].getStringRep (false).chars ()); |
128 val.appendformat (" %s", vaCoords[i].stringRep (false).chars ()); |
129 |
129 |
130 return val; |
130 return val; |
131 } |
131 } |
132 |
132 |
133 str LDTriangle::getContents () { |
133 str LDTriangle::getContents () { |
134 str val = format ("3 %d", dColor); |
134 str val = format ("3 %d", dColor); |
135 |
135 |
136 for (ushort i = 0; i < 3; ++i) |
136 for (ushort i = 0; i < 3; ++i) |
137 val.appendformat (" %s", vaCoords[i].getStringRep (false).chars ()); |
137 val.appendformat (" %s", vaCoords[i].stringRep (false).chars ()); |
138 |
138 |
139 return val; |
139 return val; |
140 } |
140 } |
141 |
141 |
142 str LDQuad::getContents () { |
142 str LDQuad::getContents () { |
143 str val = format ("4 %d", dColor); |
143 str val = format ("4 %d", dColor); |
144 |
144 |
145 for (ushort i = 0; i < 4; ++i) |
145 for (ushort i = 0; i < 4; ++i) |
146 val.appendformat (" %s", vaCoords[i].getStringRep (false).chars ()); |
146 val.appendformat (" %s", vaCoords[i].stringRep (false).chars ()); |
147 |
147 |
148 return val; |
148 return val; |
149 } |
149 } |
150 |
150 |
151 str LDCondLine::getContents () { |
151 str LDCondLine::getContents () { |
152 str val = format ("5 %d", dColor); |
152 str val = format ("5 %d", dColor); |
153 |
153 |
154 // Add the coordinates |
154 // Add the coordinates |
155 for (ushort i = 0; i < 4; ++i) |
155 for (ushort i = 0; i < 4; ++i) |
156 val.appendformat (" %s", vaCoords[i].getStringRep (false).chars ()); |
156 val.appendformat (" %s", vaCoords[i].stringRep (false).chars ()); |
157 |
157 |
158 return val; |
158 return val; |
159 } |
159 } |
160 |
160 |
161 str LDGibberish::getContents () { |
161 str LDGibberish::getContents () { |
162 return zContents; |
162 return zContents; |
163 } |
163 } |
164 |
164 |
165 str LDVertex::getContents () { |
165 str LDVertex::getContents () { |
166 return format ("0 !LDFORGE VERTEX %d %s", dColor, vPosition.getStringRep (false).chars()); |
166 return format ("0 !LDFORGE VERTEX %d %s", dColor, vPosition.stringRep (false).chars()); |
167 } |
167 } |
168 |
168 |
169 str LDEmpty::getContents () { |
169 str LDEmpty::getContents () { |
170 return str (); |
170 return str (); |
171 } |
171 } |
245 vaCoords[1] = v2; |
245 vaCoords[1] = v2; |
246 } |
246 } |
247 |
247 |
248 LDObject::~LDObject () { |
248 LDObject::~LDObject () { |
249 // Remove this object from the selection array if it is there. |
249 // Remove this object from the selection array if it is there. |
250 for (ulong i = 0; i < g_ForgeWindow->paSelection.size(); ++i) |
250 for (ulong i = 0; i < g_ForgeWindow->sel.size(); ++i) |
251 if (g_ForgeWindow->paSelection[i] == this) |
251 if (g_ForgeWindow->sel[i] == this) |
252 g_ForgeWindow->paSelection.erase (g_ForgeWindow->paSelection.begin() + i); |
252 g_ForgeWindow->sel.erase (g_ForgeWindow->sel.begin() + i); |
253 } |
253 } |
254 |
254 |
255 LDComment::~LDComment () {} |
255 LDComment::~LDComment () {} |
256 LDCondLine::~LDCondLine () {} |
256 LDCondLine::~LDCondLine () {} |
257 LDEmpty::~LDEmpty () {} |
257 LDEmpty::~LDEmpty () {} |
660 // ============================================================================= |
660 // ============================================================================= |
661 str LDRadial::getContents () { |
661 str LDRadial::getContents () { |
662 return format ("0 !LDFORGE RADIAL %s %d %d %d %d %s %s", |
662 return format ("0 !LDFORGE RADIAL %s %d %d %d %d %s %s", |
663 str (radialTypeName()).toupper ().strip (' ').chars (), |
663 str (radialTypeName()).toupper ().strip (' ').chars (), |
664 dColor, dSegments, dDivisions, dRingNum, |
664 dColor, dSegments, dDivisions, dRingNum, |
665 vPosition.getStringRep (false).chars(), mMatrix.getStringRep().chars()); |
665 vPosition.stringRep (false).chars(), mMatrix.stringRep().chars()); |
666 } |
666 } |
667 |
667 |
668 char const* g_saRadialNameRoots[] = { |
668 char const* g_saRadialNameRoots[] = { |
669 "edge", |
669 "edge", |
670 "cyli", |
670 "cyli", |