Logo ROOT   6.10/09
Reference Guide
TOCCToStep.h
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 #ifndef ROOT_TOCCToStep
13 #define ROOT_TOCCToStep
14 
15 #include "TGeoNode.h"
16 #include "TGeoMatrix.h"
17 #include "TGeoToOCC.h"
18 
19 #include <TDF_Label.hxx>
20 #include <XCAFDoc_ShapeTool.hxx>
21 #include <TDocStd_Document.hxx>
22 #include <STEPCAFControl_Writer.hxx>
23 #include <TDF_Label.hxx>
24 #include <TopoDS_Shape.hxx>
25 
26 
27 class TOCCToStep {
28 
29 private:
30  typedef std::map <TGeoVolume *, TDF_Label> LabelMap_t;
31 
32  STEPCAFControl_Writer fWriter; //the step file pointer
33  Handle(TDocStd_Document) fDoc; //the step document element
34  LabelMap_t fTree; //tree of Label's volumes
35  TDF_Label fLabel; //label of the OCC shape elemet
37  TopoDS_Shape fShape; //OCC shape (translated root shape)
38 
39  void OCCDocCreation();
40  TopoDS_Shape AssemblyShape(TGeoVolume *vol, TGeoHMatrix m);
41  TGeoVolume *GetVolumeOfLabel(TDF_Label fLabel);
42  TDF_Label GetLabelOfVolume(TGeoVolume * v);
43  void AddChildLabel(TDF_Label mother, TDF_Label child, TopLoc_Location loc);
44  TopLoc_Location CalcLocation(TGeoHMatrix matrix);
45 
46 public:
47  TOCCToStep();
48  void PrintAssembly();
49  TDF_Label OCCShapeCreation(TGeoManager *m);
51  void OCCWriteStep(const char *fname);
52 };
53 
54 #endif
The manager class for any TGeo geometry.
Definition: TGeoManager.h:37
void OCCWriteStep(const char *fname)
Definition: TOCCToStep.cxx:145
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition: TGeoVolume.h:48
void AddChildLabel(TDF_Label mother, TDF_Label child, TopLoc_Location loc)
Definition: TOCCToStep.cxx:182
TGeoVolume * GetVolumeOfLabel(TDF_Label fLabel)
Definition: TOCCToStep.cxx:171
Matrix class used for computing global transformations Should NOT be used for node definition...
Definition: TGeoMatrix.h:408
void PrintAssembly()
Definition: TOCCToStep.cxx:250
STEPCAFControl_Writer fWriter
Definition: TOCCToStep.h:32
std::map< TGeoVolume *, TDF_Label > LabelMap_t
Definition: TOCCToStep.h:30
void OCCTreeCreation(TGeoManager *m)
Definition: TOCCToStep.cxx:211
SVector< double, 2 > v
Definition: Dict.h:5
TMarker * m
Definition: textangle.C:8
LabelMap_t fTree
Definition: TOCCToStep.h:34
TopoDS_Shape fShape
Definition: TOCCToStep.h:37
void OCCDocCreation()
Definition: TOCCToStep.cxx:59
TopLoc_Location CalcLocation(TGeoHMatrix matrix)
Definition: TOCCToStep.cxx:190
TGeoToOCC fRootShape
Definition: TOCCToStep.h:36
TDF_Label fLabel
Definition: TOCCToStep.h:35
TDF_Label OCCShapeCreation(TGeoManager *m)
Logical fTree creation.
Definition: TOCCToStep.cxx:72
TDF_Label GetLabelOfVolume(TGeoVolume *v)
Definition: TOCCToStep.cxx:160
Handle(TDocStd_Document) fDoc
TopoDS_Shape AssemblyShape(TGeoVolume *vol, TGeoHMatrix m)