ROOT
6.06/09
Reference Guide
ROOT Home Page
Main Page
Related Pages
User's Classes
Namespaces
All Classes
Files
Release Notes
File List
File Members
geom
geocad
src
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
48
ClassImp
(
TGeoToStep
)
49
50
TGeoToStep
::
TGeoToStep
():
TObject
(), fGeometry(0)
51
{
52
53
}
54
55
TGeoToStep::TGeoToStep
(
TGeoManager
*geom):
TObject
(), fGeometry(geom)
56
{
57
58
}
59
60
TGeoToStep::~TGeoToStep
()
61
{
62
if
(
fGeometry
)
delete
fGeometry
;
63
}
64
65
void
*
TGeoToStep::CreateGeometry
()
66
{
67
//ROOT CAD CONVERSION
68
fCreate
=
new
TOCCToStep
();
69
fCreate
->
OCCShapeCreation
(
fGeometry
);
70
fCreate
->
OCCTreeCreation
(
fGeometry
);
71
fCreate
->
OCCWriteStep
(
"geometry.stp"
);
72
//fCreate->PrintAssembly();
73
delete
(
fCreate
);
74
return
NULL
;
75
}
TGeoManager
Definition:
TGeoManager.h:46
TClass.h
TGeoToStep::CreateGeometry
void * CreateGeometry()
Definition:
TGeoToStep.cxx:65
TOCCToStep::OCCWriteStep
void OCCWriteStep(const char *fname)
Definition:
TOCCToStep.cxx:145
TGeoToStep::fGeometry
TGeoManager * fGeometry
Definition:
TGeoToStep.h:26
ClassImp
ClassImp(TGeoToStep) TGeoToStep
Definition:
TGeoToStep.cxx:48
TGeoToStep::~TGeoToStep
~TGeoToStep()
Definition:
TGeoToStep.cxx:60
TGeoToStep::TGeoToStep
TGeoToStep()
TOCCToStep.h
TOCCToStep::OCCTreeCreation
void OCCTreeCreation(TGeoManager *m)
Definition:
TOCCToStep.cxx:211
TOCCToStep
Definition:
TOCCToStep.h:33
TGeoToStep.h
TString.h
TOCCToStep::OCCShapeCreation
TDF_Label OCCShapeCreation(TGeoManager *m)
Logical fTree creation.
Definition:
TOCCToStep.cxx:72
TObject
Mother of all ROOT objects.
Definition:
TObject.h:58
TGeoManager.h
NULL
#define NULL
Definition:
Rtypes.h:82
TGeoToStep::fCreate
TOCCToStep * fCreate
Definition:
TGeoToStep.h:27
TGeoToStep
Definition:
TGeoToStep.h:23