ROOT  6.06/09
Reference Guide
TGeoToStep.cxx
Go to the documentation of this file.
1 // @(#)geom/geocad:$Id$
2 // Author: Cinzia Luzzi 5/5/2012
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2012, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 ////////////////////////////////////////////////////////////////////////////////
13 // TGeoToStep Class //
14 // -------------------- //
15 // //
16 // This class is an interface to convert ROOT's geometry file //
17 // to STEP file. The TGeoToStep Class takes a gGeoManager pointer and gives //
18 // back a STEP file. gGeoManager is the instance of TGeoManager class //
19 // containing tree of geometries creating resulting geometry. //
20 // Standard for the Exchange of Product model data (STEP) is an international //
21 // standard for the exchange of industrial product data. It is typically used //
22 // to exchange data between various CAD, CAM and CAE applications. //
23 // TGeoToStep Class is using RootOCC class to translate the root geometry //
24 // in the corresponding OpenCascade geometry and and TOCCToStep to write the //
25 // OpenCascade geometry to the step File. //
26 // OpenCascade Technology (OCC) is a software development platform freely //
27 // available in open source. It includes C++ components for 3D surface and //
28 // solid modeling,visualization, data exchange and rapid application //
29 // development. For more information about OCC see http://www.opencascade.org //
30 // Each object in ROOT is represented by an OCC TopoDS_Shape //
31 // //
32 // This class is needed to be instanciated and can be used calling the //
33 // CreateGeometry method: //
34 // TGeoToStep * mygeom= new TGeoToStep(gGeoManager); //
35 // mygeom->CreateGeometry(); //
36 // //
37 // The resuling STEP file will be saved in the current directory and called //
38 // geometry.stp //
39 // To compile the TGeoCad module on ROOT, OpenCascade must be installed! //
40 ////////////////////////////////////////////////////////////////////////////////
41 
42 #include "TGeoManager.h"
43 #include "TOCCToStep.h"
44 #include "TGeoToStep.h"
45 #include "TString.h"
46 #include "TClass.h"
47 
49 
50 TGeoToStep::TGeoToStep():TObject(), fGeometry(0)
51 {
52 
53 }
54 
55 TGeoToStep::TGeoToStep(TGeoManager *geom):TObject(), fGeometry(geom)
56 {
57 
58 }
59 
61 {
62  if (fGeometry) delete fGeometry;
63 }
64 
66 {
67  //ROOT CAD CONVERSION
68  fCreate = new TOCCToStep();
71  fCreate->OCCWriteStep("geometry.stp");
72  //fCreate->PrintAssembly();
73  delete(fCreate);
74  return NULL;
75 }
void * CreateGeometry()
Definition: TGeoToStep.cxx:65
void OCCWriteStep(const char *fname)
Definition: TOCCToStep.cxx:145
TGeoManager * fGeometry
Definition: TGeoToStep.h:26
ClassImp(TGeoToStep) TGeoToStep
Definition: TGeoToStep.cxx:48
void OCCTreeCreation(TGeoManager *m)
Definition: TOCCToStep.cxx:211
TDF_Label OCCShapeCreation(TGeoManager *m)
Logical fTree creation.
Definition: TOCCToStep.cxx:72
Mother of all ROOT objects.
Definition: TObject.h:58
#define NULL
Definition: Rtypes.h:82
TOCCToStep * fCreate
Definition: TGeoToStep.h:27