Logo ROOT   6.16/01
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
28
29private:
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
35 // The following probably shouldn't be data members.
36 LabelMap_t fTree; //tree of Label's volumes
37 TDF_Label fLabel; //label of the OCC shape element
39 TopoDS_Shape fShape; //OCC shape (translated root shape)
40
41 void OCCDocCreation();
44 TDF_Label GetLabelOfVolume(TGeoVolume * v);
45 void AddChildLabel(TDF_Label mother, TDF_Label child, TopLoc_Location loc);
46 TopLoc_Location CalcLocation(TGeoHMatrix matrix);
47
48 void FillOCCWithNode(TGeoManager* m, TGeoNode* currentNode, TGeoIterator& nextNode, int level, int max_level, int level1_skipped);
49
50public:
51 TOCCToStep();
52 void PrintAssembly();
53 TDF_Label OCCShapeCreation(TGeoManager *m);
54 void OCCTreeCreation(TGeoManager *m, int max_level = -1);
55 bool OCCPartialTreeCreation(TGeoManager *m, const char* node_name, int max_level = -1);
56 bool OCCPartialTreeCreation(TGeoManager *m, std::map<std::string,int> part_name_levels);
57
58
59 void OCCWriteStep(const char *fname);
60};
61
62#endif
SVector< double, 2 > v
Definition: Dict.h:5
Matrix class used for computing global transformations Should NOT be used for node definition.
Definition: TGeoMatrix.h:421
A geometry iterator.
Definition: TGeoNode.h:244
The manager class for any TGeo geometry.
Definition: TGeoManager.h:39
A node represent a volume positioned inside another.They store links to both volumes and to the TGeoM...
Definition: TGeoNode.h:41
This class contains implementation of converting ROOT's geometry shapes to OpenCascade shapes.
Definition: TGeoToOCC.h:31
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition: TGeoVolume.h:53
This class contains implementation of writing OpenCascade's geometry shapes to the STEP file reproduc...
Definition: TOCCToStep.h:27
std::map< TGeoVolume *, TDF_Label > LabelMap_t
Definition: TOCCToStep.h:30
LabelMap_t fTree
Definition: TOCCToStep.h:36
TGeoToOCC fRootShape
Definition: TOCCToStep.h:38
TopoDS_Shape AssemblyShape(TGeoVolume *vol, TGeoHMatrix m)
STEPCAFControl_Writer fWriter
Definition: TOCCToStep.h:32
void PrintAssembly()
Definition: TOCCToStep.cxx:394
TGeoVolume * GetVolumeOfLabel(TDF_Label fLabel)
Definition: TOCCToStep.cxx:168
TopLoc_Location CalcLocation(TGeoHMatrix matrix)
Definition: TOCCToStep.cxx:187
TDF_Label fLabel
Definition: TOCCToStep.h:37
bool OCCPartialTreeCreation(TGeoManager *m, const char *node_name, int max_level=-1)
Definition: TOCCToStep.cxx:255
Handle(TDocStd_Document) fDoc
void OCCWriteStep(const char *fname)
Definition: TOCCToStep.cxx:142
TDF_Label GetLabelOfVolume(TGeoVolume *v)
Definition: TOCCToStep.cxx:157
void FillOCCWithNode(TGeoManager *m, TGeoNode *currentNode, TGeoIterator &nextNode, int level, int max_level, int level1_skipped)
Definition: TOCCToStep.cxx:349
void OCCDocCreation()
Definition: TOCCToStep.cxx:58
TopoDS_Shape fShape
Definition: TOCCToStep.h:39
TDF_Label OCCShapeCreation(TGeoManager *m)
Logical fTree creation.
Definition: TOCCToStep.cxx:71
void AddChildLabel(TDF_Label mother, TDF_Label child, TopLoc_Location loc)
Definition: TOCCToStep.cxx:179
void OCCTreeCreation(TGeoManager *m, int max_level=-1)
Definition: TOCCToStep.cxx:208
auto * m
Definition: textangle.C:8