10 OCCViewer* myOCCViewer;
13 bool InitViewer(System::IntPtr wnd)
15 if (myOCCViewer != NULL)
16 return myOCCViewer->InitViewer(wnd.ToPointer());
21 bool ImportBrep(System::String^ filename)
23 if (myOCCViewer == NULL)
25 int length = filename->Length;
26 char * fname = new char[length+1];
27 for(int i = 0; i<length; i++)
28 fname[i] = (char)filename->ToCharArray()[i];
31 bool res = myOCCViewer->ImportBRep(fname);
38 if (myOCCViewer != NULL)
39 myOCCViewer->RedrawView();
44 if (myOCCViewer != NULL)
45 myOCCViewer->UpdateView();
48 void SetDegenerateModeOn(void)
50 if (myOCCViewer != NULL)
51 myOCCViewer->SetDegenerateModeOn();
54 void SetDegenerateModeOff(void)
56 if (myOCCViewer != NULL)
57 myOCCViewer->SetDegenerateModeOff();
60 void WindowFitAll(int Xmin, int Ymin, int Xmax, int Ymax)
62 if (myOCCViewer != NULL)
63 myOCCViewer->WindowFitAll(Xmin, Ymin, Xmax, Ymax);
66 void Place(int x, int y, float zoomFactor)
68 if (myOCCViewer != NULL)
69 myOCCViewer->Place(x, y, zoomFactor);
72 void Zoom(int x1, int y1, int x2, int y2)
74 if (myOCCViewer != NULL)
75 myOCCViewer->Zoom(x1, y1, x2, y2);
78 void Pan(int x, int y)
80 if (myOCCViewer != NULL)
81 myOCCViewer->Pan(x, y);
84 void Rotation(int x, int y)
86 if (myOCCViewer != NULL)
87 myOCCViewer->Rotation(x, y);
90 void StartRotation(int x, int y)
92 if (myOCCViewer != NULL)
93 myOCCViewer->StartRotation(x, y);
96 void Select(int x1, int y1, int x2, int y2)
98 if (myOCCViewer != NULL)
99 myOCCViewer->Select(x1, y1, x2, y2);
104 if (myOCCViewer != NULL)
105 myOCCViewer->Select();
108 void MoveTo(int x, int y)
110 if (myOCCViewer != NULL)
111 myOCCViewer->MoveTo(x, y);
114 void ShiftSelect(int x1, int y1, int x2, int y2)
116 if (myOCCViewer != NULL)
117 myOCCViewer->ShiftSelect(x1, y1, x2, y2);
120 void ShiftSelect(void)
122 if (myOCCViewer != NULL)
123 myOCCViewer->ShiftSelect();
129 if (myOCCViewer != NULL)
130 myOCCViewer->BackgroundColor(r,g,b);
137 if (myOCCViewer != NULL)
138 myOCCViewer->BackgroundColor(r,g,b);
145 if (myOCCViewer != NULL)
146 myOCCViewer->BackgroundColor(r,g,b);
150 void UpdateCurrentViewer(void)
152 if (myOCCViewer != NULL)
153 myOCCViewer->UpdateCurrentViewer();
158 if (myOCCViewer != NULL)
159 myOCCViewer->FrontView();
164 if (myOCCViewer != NULL)
165 myOCCViewer->TopView();
170 if (myOCCViewer != NULL)
171 myOCCViewer->LeftView();
176 if (myOCCViewer != NULL)
177 myOCCViewer->BackView();
182 if (myOCCViewer != NULL)
183 myOCCViewer->RightView();
186 void BottomView(void)
188 if (myOCCViewer != NULL)
189 myOCCViewer->BottomView();
194 if (myOCCViewer != NULL)
195 myOCCViewer->AxoView();
200 if (myOCCViewer != NULL)
201 return myOCCViewer->Scale();
206 void ZoomAllView(void)
208 if (myOCCViewer != NULL)
209 myOCCViewer->ZoomAllView();
214 if (myOCCViewer != NULL)
215 myOCCViewer->ResetView();
218 void SetDisplayMode(int aMode)
220 if (myOCCViewer != NULL)
221 myOCCViewer->SetDisplayMode(aMode);
224 void SetColor(int r, int g, int b)
226 if (myOCCViewer != NULL)
227 myOCCViewer->SetColor(r, g, b);
233 if (myOCCViewer != NULL)
234 myOCCViewer->ObjectColor(r, g, b);
241 if (myOCCViewer != NULL)
242 myOCCViewer->ObjectColor(r, g, b);
249 if (myOCCViewer != NULL)
250 myOCCViewer->ObjectColor(r, g, b);
254 void SetBackgroundColor(int r, int g, int b)
256 if (myOCCViewer != NULL)
257 myOCCViewer->SetBackgroundColor(r, g, b);
260 void EraseObjects(void)
262 if (myOCCViewer != NULL)
263 myOCCViewer->EraseObjects();
266 float GetOCCVersion(void)
268 if (myOCCViewer == NULL)
271 return myOCCViewer->GetVersion();
274 void SetMaterial(int theMaterial)
276 if (myOCCViewer != NULL)
277 myOCCViewer->SetMaterial(theMaterial);
280 void SetTransparency(int TheTrans)
282 if (myOCCViewer != NULL)
283 myOCCViewer->SetTransparency(TheTrans);
286 bool TranslateModel(System::String^ filename, int format, bool IsImport)
288 if (myOCCViewer == NULL)
290 int length = filename->Length;
291 char * fname = new char[length+1];
292 for(int i = 0; i<length; i++)
293 fname[i] = (char)filename->ToCharArray()[i];
295 fname[length] = '\0';
302 res=myOCCViewer->ImportBRep(fname);
305 res=myOCCViewer->ImportCsfdb(fname);
308 res=myOCCViewer->ImportStep(fname);
311 res=myOCCViewer->ImportIges(fname);
321 res=myOCCViewer->ExportBRep(fname);
324 res=myOCCViewer->ExpotStep(fname);
327 res=myOCCViewer->ExportIges(fname);
330 res=myOCCViewer->ExportVrml(fname);
333 res=myOCCViewer->ExportStl(fname);
336 res=myOCCViewer->Dump(fname);
345 bool IsObjectSelected(void)
347 if (myOCCViewer != NULL)
348 return myOCCViewer->IsObjectSelected();
353 int DisplayMode(void)
355 if (myOCCViewer != NULL)
356 return myOCCViewer->DisplayMode();
360 void CreateNewView(System::IntPtr wnd)
362 if (myOCCViewer != NULL)
363 myOCCViewer->CreateNewView(wnd.ToPointer());
366 bool SetAISContext(shell^ v)
368 if (myOCCViewer != NULL)
369 return this->myOCCViewer->SetAISContext(v->GetOCCViewer());
374 OCCViewer* GetOCCViewer(void)
379 void InitOCCViewer(void)
381 myOCCViewer = new OCCViewer();
384 int CharToInt(System::String^ symbol)
386 if (myOCCViewer == NULL)
388 char s = (char)symbol->ToCharArray()[0];
389 return myOCCViewer->CharToInt(s);