3 #include "GEOM_IBasicOperations_i.hh"
7 #include "Utils_ExceptHandlers.hxx"
9 #include "GEOM_Engine.hxx"
10 #include "GEOM_Object.hxx"
12 //=============================================================================
16 //=============================================================================
17 GEOM_IBasicOperations_i::GEOM_IBasicOperations_i (PortableServer::POA_ptr thePOA,
18 GEOM::GEOM_Gen_ptr theEngine,
19 ::GEOMImpl_IBasicOperations* theImpl)
20 :GEOM_IOperations_i(thePOA, theEngine, theImpl)
22 MESSAGE("GEOM_IBasicOperations_i::GEOM_IBasicOperations_i");
25 //=============================================================================
29 //=============================================================================
30 GEOM_IBasicOperations_i::~GEOM_IBasicOperations_i()
32 MESSAGE("GEOM_IBasicOperations_i::~GEOM_IBasicOperations_i");
36 //=============================================================================
40 //=============================================================================
41 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointXYZ
42 (CORBA::Double theX, CORBA::Double theY, CORBA::Double theZ)
44 GEOM::GEOM_Object_var aGEOMObject;
47 GetOperations()->SetNotDone();
51 Handle(GEOM_Object) anObject = GetOperations()->MakePointXYZ(theX, theY, theZ);
52 if (!GetOperations()->IsDone() || anObject.IsNull())
53 return aGEOMObject._retn();
55 return GetObject(anObject);
58 //=============================================================================
60 * MakePointWithReference
62 //=============================================================================
63 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointWithReference
64 (GEOM::GEOM_Object_ptr theReference, CORBA::Double theX, CORBA::Double theY, CORBA::Double theZ)
66 GEOM::GEOM_Object_var aGEOMObject;
69 GetOperations()->SetNotDone();
71 if(theReference == NULL) return aGEOMObject._retn();
73 //Get the reference point
75 Handle(GEOM_Object) aRefernce = GetOperations()->GetEngine()->GetObject
76 (theReference->GetStudyID(), theReference->GetEntry());
77 if (aRefernce.IsNull()) return aGEOMObject._retn();
81 Handle(GEOM_Object) anObject =
82 GetOperations()->MakePointWithReference(aRefernce, theX, theY, theZ);
83 if (!GetOperations()->IsDone() || anObject.IsNull())
84 return aGEOMObject._retn();
86 return GetObject(anObject);
89 //=============================================================================
93 //=============================================================================
94 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointOnCurve
95 (GEOM::GEOM_Object_ptr theCurve, CORBA::Double theParameter)
97 GEOM::GEOM_Object_var aGEOMObject;
100 GetOperations()->SetNotDone();
102 if (theCurve == NULL) return aGEOMObject._retn();
104 //Get the reference curve
106 Handle(GEOM_Object) aRefernce = GetOperations()->GetEngine()->GetObject
107 (theCurve->GetStudyID(), theCurve->GetEntry());
108 if (aRefernce.IsNull()) return aGEOMObject._retn();
112 Handle(GEOM_Object) anObject =
113 GetOperations()->MakePointOnCurve(aRefernce, theParameter);
114 if (!GetOperations()->IsDone() || anObject.IsNull())
115 return aGEOMObject._retn();
117 return GetObject(anObject);
121 //=============================================================================
125 //=============================================================================
126 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakeVectorDXDYDZ
127 (CORBA::Double theDX, CORBA::Double theDY, CORBA::Double theDZ)
129 GEOM::GEOM_Object_var aGEOMObject;
131 //Set a not done flag
132 GetOperations()->SetNotDone();
136 Handle(GEOM_Object) anObject = GetOperations()->MakeVectorDXDYDZ(theDX, theDY, theDZ);
137 if (!GetOperations()->IsDone() || anObject.IsNull())
138 return aGEOMObject._retn();
140 return GetObject(anObject);
143 //=============================================================================
147 //=============================================================================
148 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakeVectorTwoPnt
149 (GEOM::GEOM_Object_ptr thePnt1, GEOM::GEOM_Object_ptr thePnt2)
151 GEOM::GEOM_Object_var aGEOMObject;
153 //Set a not done flag
154 GetOperations()->SetNotDone();
156 if (thePnt1 == NULL || thePnt2 == NULL) return aGEOMObject._retn();
158 //Get the reference points
160 Handle(GEOM_Object) aRef1 = GetOperations()->GetEngine()->GetObject
161 (thePnt1->GetStudyID(), thePnt1->GetEntry());
162 Handle(GEOM_Object) aRef2 = GetOperations()->GetEngine()->GetObject
163 (thePnt2->GetStudyID(), thePnt2->GetEntry());
164 if (aRef1.IsNull() || aRef2.IsNull()) return aGEOMObject._retn();
168 Handle(GEOM_Object) anObject =
169 GetOperations()->MakeVectorTwoPnt(aRef1, aRef2);
170 if (!GetOperations()->IsDone() || anObject.IsNull())
171 return aGEOMObject._retn();
173 return GetObject(anObject);
177 //=============================================================================
181 //=============================================================================
182 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakeLineTwoPnt
183 (GEOM::GEOM_Object_ptr thePnt1, GEOM::GEOM_Object_ptr thePnt2)
185 GEOM::GEOM_Object_var aGEOMObject;
187 //Set a not done flag
188 GetOperations()->SetNotDone();
190 if (thePnt1 == NULL || thePnt2 == NULL) return aGEOMObject._retn();
192 //Get the reference points
194 Handle(GEOM_Object) aRef1 = GetOperations()->GetEngine()->GetObject
195 (thePnt1->GetStudyID(), thePnt1->GetEntry());
196 Handle(GEOM_Object) aRef2 = GetOperations()->GetEngine()->GetObject
197 (thePnt2->GetStudyID(), thePnt2->GetEntry());
198 if (aRef1.IsNull() || aRef2.IsNull()) return aGEOMObject._retn();
202 Handle(GEOM_Object) anObject =
203 GetOperations()->MakeLineTwoPnt(aRef1, aRef2);
204 if (!GetOperations()->IsDone() || anObject.IsNull())
205 return aGEOMObject._retn();
207 return GetObject(anObject);
211 //=============================================================================
215 //=============================================================================
216 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePlanePntVec
217 (GEOM::GEOM_Object_ptr thePnt, GEOM::GEOM_Object_ptr theVec,
218 CORBA::Double theTrimSize)
220 GEOM::GEOM_Object_var aGEOMObject;
222 //Set a not done flag
223 GetOperations()->SetNotDone();
225 if (thePnt == NULL || theVec == NULL) return aGEOMObject._retn();
229 Handle(GEOM_Object) aRef1 = GetOperations()->GetEngine()->GetObject
230 (thePnt->GetStudyID(), thePnt->GetEntry());
231 Handle(GEOM_Object) aRef2 = GetOperations()->GetEngine()->GetObject
232 (theVec->GetStudyID(), theVec->GetEntry());
233 if (aRef1.IsNull() || aRef2.IsNull()) return aGEOMObject._retn();
237 Handle(GEOM_Object) anObject =
238 GetOperations()->MakePlanePntVec(aRef1, aRef2, theTrimSize);
239 if (!GetOperations()->IsDone() || anObject.IsNull())
240 return aGEOMObject._retn();
242 return GetObject(anObject);
245 //=============================================================================
249 //=============================================================================
250 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePlaneThreePnt
251 (GEOM::GEOM_Object_ptr thePnt1, GEOM::GEOM_Object_ptr thePnt2,
252 GEOM::GEOM_Object_ptr thePnt3, CORBA::Double theTrimSize)
254 GEOM::GEOM_Object_var aGEOMObject;
256 //Set a not done flag
257 GetOperations()->SetNotDone();
259 if (thePnt1 == NULL || thePnt2 == NULL || thePnt3 == NULL)
260 return aGEOMObject._retn();
262 //Get the reference points
264 Handle(GEOM_Object) aRef1 = GetOperations()->GetEngine()->GetObject
265 (thePnt1->GetStudyID(), thePnt1->GetEntry());
266 Handle(GEOM_Object) aRef2 = GetOperations()->GetEngine()->GetObject
267 (thePnt2->GetStudyID(), thePnt2->GetEntry());
268 Handle(GEOM_Object) aRef3 = GetOperations()->GetEngine()->GetObject
269 (thePnt3->GetStudyID(), thePnt3->GetEntry());
270 if (aRef1.IsNull() || aRef2.IsNull() || aRef3.IsNull())
271 return aGEOMObject._retn();
275 Handle(GEOM_Object) anObject =
276 GetOperations()->MakePlaneThreePnt(aRef1, aRef2, aRef3, theTrimSize);
277 if (!GetOperations()->IsDone() || anObject.IsNull())
278 return aGEOMObject._retn();
280 return GetObject(anObject);
283 //=============================================================================
287 //=============================================================================
288 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePlaneFace
289 (GEOM::GEOM_Object_ptr theFace, CORBA::Double theTrimSize)
291 GEOM::GEOM_Object_var aGEOMObject;
293 //Set a not done flag
294 GetOperations()->SetNotDone();
296 if (theFace == NULL) return aGEOMObject._retn();
298 //Get the reference face
300 Handle(GEOM_Object) aRef = GetOperations()->GetEngine()->GetObject
301 (theFace->GetStudyID(), theFace->GetEntry());
302 if (aRef.IsNull()) return aGEOMObject._retn();
306 Handle(GEOM_Object) anObject =
307 GetOperations()->MakePlaneFace(aRef, theTrimSize);
308 if (!GetOperations()->IsDone() || anObject.IsNull())
309 return aGEOMObject._retn();
311 return GetObject(anObject);
315 //=============================================================================
319 //=============================================================================
320 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakeMarker
321 (CORBA::Double theOX , CORBA::Double theOY , CORBA::Double theOZ,
322 CORBA::Double theXDX, CORBA::Double theXDY, CORBA::Double theXDZ,
323 CORBA::Double theYDX, CORBA::Double theYDY, CORBA::Double theYDZ)
325 GEOM::GEOM_Object_var aGEOMObject;
327 //Set a not done flag
328 GetOperations()->SetNotDone();
331 Handle(GEOM_Object) anObject = GetOperations()->MakeMarker(theOX , theOY , theOZ,
332 theXDX, theXDY, theXDZ,
333 theYDX, theYDY, theYDZ);
334 if (!GetOperations()->IsDone() || anObject.IsNull())
335 return aGEOMObject._retn();
337 return GetObject(anObject);