Logo ROOT   6.12/07
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 /** \class TGeoToStep
13 \ingroup Geometry_cad
14 
15 This class is an interface to convert ROOT's geometry file
16 to STEP file. The TGeoToStep Class takes a gGeoManager pointer and gives
17 back a STEP file. gGeoManager is the instance of TGeoManager class
18 containing tree of geometries creating resulting geometry.
19 Standard for the Exchange of Product model data (STEP) is an international
20 standard for the exchange of industrial product data. It is typically used
21 to exchange data between various CAD, CAM and CAE applications.
22 TGeoToStep Class is using RootOCC class to translate the root geometry
23 in the corresponding OpenCascade geometry and and TOCCToStep to write the
24 OpenCascade geometry to the step File.
25 OpenCascade Technology (OCC) is a software development platform freely
26 available in open source. It includes C++ components for 3D surface and
27 solid modeling,visualization, data exchange and rapid application
28 development. For more information about OCC see http://www.opencascade.org
29 Each object in ROOT is represented by an OCC TopoDS_Shape
30 
31 This class is needed to be instantiated and can be used calling the
32 CreateGeometry method:
33 
34 ~~~ {.cpp}
35  TGeoToStep * mygeom= new TGeoToStep(gGeoManager);
36  mygeom->CreateGeometry();
37 ~~~
38 
39 The resulting STEP file will be saved in the current directory and called
40 geometry.stp
41 To compile the TGeoCad module on ROOT, OpenCascade must be installed!
42 */
43 
44 #include "TGeoManager.h"
45 #include "TOCCToStep.h"
46 #include "TGeoToStep.h"
47 #include "TString.h"
48 #include "TClass.h"
49 
51 
53 {
54 
55 }
56 
58 {
59 
60 }
61 
63 {
64  if (fGeometry) delete fGeometry;
65 }
66 
68 {
69  //ROOT CAD CONVERSION
70  fCreate = new TOCCToStep();
73  fCreate->OCCWriteStep("geometry.stp");
74  //fCreate->PrintAssembly();
75  delete(fCreate);
76  return NULL;
77 }
The manager class for any TGeo geometry.
Definition: TGeoManager.h:38
void * CreateGeometry()
Definition: TGeoToStep.cxx:67
void OCCWriteStep(const char *fname)
Definition: TOCCToStep.cxx:144
TGeoManager * fGeometry
Definition: TGeoToStep.h:24
void OCCTreeCreation(TGeoManager *m)
Definition: TOCCToStep.cxx:210
This class contains implementation of writing OpenCascade's geometry shapes to the STEP file reproduc...
Definition: TOCCToStep.h:27
#define ClassImp(name)
Definition: Rtypes.h:359
TDF_Label OCCShapeCreation(TGeoManager *m)
Logical fTree creation.
Definition: TOCCToStep.cxx:71
Mother of all ROOT objects.
Definition: TObject.h:37
TOCCToStep * fCreate
Definition: TGeoToStep.h:25
This class is an interface to convert ROOT's geometry file to STEP file.
Definition: TGeoToStep.h:21