ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 #ifndef ROOT_TGeoNode
16 #include "TGeoNode.h"
17 #endif
18 #ifndef ROOT_TGeoMatrix
19 #include "TGeoMatrix.h"
20 #endif
21 #ifndef ROOT_TGeoToOCC
22 #include "TGeoToOCC.h"
23 #endif
24 
25 #include <TDF_Label.hxx>
26 #include <XCAFDoc_ShapeTool.hxx>
27 #include <TDocStd_Document.hxx>
28 #include <STEPCAFControl_Writer.hxx>
29 #include <TDF_Label.hxx>
30 #include <TopoDS_Shape.hxx>
31 
32 
33 class TOCCToStep {
34 
35 private:
36  typedef std::map <TGeoVolume *, TDF_Label> LabelMap_t;
37 
38  STEPCAFControl_Writer fWriter; //the step file pointer
39  Handle(TDocStd_Document) fDoc; //the step document element
40  LabelMap_t fTree; //tree of Label's volumes
41  TDF_Label fLabel; //label of the OCC shape elemet
42  TGeoToOCC fRootShape;
43  TopoDS_Shape fShape; //OCC shape (translated root shape)
44 
45  void OCCDocCreation();
46  TopoDS_Shape AssemblyShape(TGeoVolume *vol, TGeoHMatrix m);
47  TGeoVolume *GetVolumeOfLabel(TDF_Label fLabel);
48  TDF_Label GetLabelOfVolume(TGeoVolume * v);
49  void AddChildLabel(TDF_Label mother, TDF_Label child, TopLoc_Location loc);
50  TopLoc_Location CalcLocation(TGeoHMatrix matrix);
51 
52 public:
53  TOCCToStep();
54  void PrintAssembly();
55  TDF_Label OCCShapeCreation(TGeoManager *m);
57  void OCCWriteStep(const char *fname);
58 };
59 
60 #endif
void OCCWriteStep(const char *fname)
Definition: TOCCToStep.cxx:145
void AddChildLabel(TDF_Label mother, TDF_Label child, TopLoc_Location loc)
Definition: TOCCToStep.cxx:182
TGeoVolume * GetVolumeOfLabel(TDF_Label fLabel)
Definition: TOCCToStep.cxx:171
STEPCAFControl_Writer fWriter
Definition: TOCCToStep.h:38
std::map< TGeoVolume *, TDF_Label > LabelMap_t
Definition: TOCCToStep.h:36
void OCCTreeCreation(TGeoManager *m)
Definition: TOCCToStep.cxx:211
TopLoc_Location CalcLocation(TGeoHMatrix matrix)
Definition: TOCCToStep.cxx:190
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)