ATLAS Offline Software
Loading...
Searching...
No Matches
VP1Floor::Imp Class Reference
Collaboration diagram for VP1Floor::Imp:

Public Member Functions

 Imp (VP1Floor *, SoSeparator *attachsep)
void rebuild3DObjects ()
void updateColour ()

Public Attributes

VP1Floortheclass
SoSeparator * attachSep
bool shown
SbColor4f colourAndTransp
double extent
double spacing
double vertpos
SoSeparator * sep

Detailed Description

Definition at line 46 of file VP1Floor.cxx.

Constructor & Destructor Documentation

◆ Imp()

VP1Floor::Imp::Imp ( VP1Floor * tc,
SoSeparator * attachsep )

Definition at line 83 of file VP1Floor.cxx.

84 : theclass(tc), attachSep(as), shown(false),
85 colourAndTransp(SbColor4f(1,1,1,1)),extent(10), spacing(1), vertpos(0), sep(0)
86{
87 attachSep->ref();
88}
static Double_t tc
double vertpos
Definition VP1Floor.cxx:57
VP1Floor * theclass
Definition VP1Floor.cxx:50
double spacing
Definition VP1Floor.cxx:56
SbColor4f colourAndTransp
Definition VP1Floor.cxx:54
double extent
Definition VP1Floor.cxx:55
SoSeparator * attachSep
Definition VP1Floor.cxx:51
SoSeparator * sep
Definition VP1Floor.cxx:59

Member Function Documentation

◆ rebuild3DObjects()

void VP1Floor::Imp::rebuild3DObjects ( )

Definition at line 91 of file VP1Floor.cxx.

92{
93 theclass->messageVerbose("(Re)building 3D objects");
94
95 if (sep) {
96 sep->removeAllChildren();
97 } else {
98 sep = new SoSeparator;
99 sep->ref();
100 }
101
102 const bool save = sep->enableNotify(false);
103
104 int nmax; double distmax;
106 nmax = 10;
107 distmax = 10*SYSTEM_OF_UNITS::m;
108 theclass->message("ERROR: Problems calculating nmax/distmax.");
109 }
110
111 SoVertexProperty * floor_vertices = new SoVertexProperty();
112 int ivert(0);
113 int nsublines(0);
114 for (int ix = -nmax; ix<=nmax; ++ix) {
115 double x = ix*spacing;
116 floor_vertices->vertex.set1Value(ivert++,x,vertpos,-distmax);
117 floor_vertices->vertex.set1Value(ivert++,x,vertpos,+distmax);
118 ++nsublines;
119 }
120 for (int iz = -nmax; iz<=nmax; ++iz) {
121 double z = iz*spacing;
122 floor_vertices->vertex.set1Value(ivert++,-distmax,vertpos,z);
123 floor_vertices->vertex.set1Value(ivert++,+distmax,vertpos,z);
124 ++nsublines;
125 }
126
127 floor_vertices->materialBinding=SoMaterialBinding::OVERALL;
128 floor_vertices->normalBinding=SoNormalBinding::OVERALL;
129 SoLineSet * line = new SoLineSet();
130 line->numVertices.enableNotify(FALSE);
131 line->numVertices.setNum(nsublines);
132 for (int i=0;i<nsublines;++i)
133 line->numVertices.set1Value(i,2);
134 line->vertexProperty = floor_vertices;
135 line->numVertices.enableNotify(TRUE);
136 line->numVertices.touch();
137
138 sep->addChild(line);
139 updateColour();
140
141 if (save) {
142 sep->enableNotify(true);
143 sep->touch();
144 }
145
146}
const int nmax(200)
#define x
#define z
void updateColour()
Definition VP1Floor.cxx:149
static bool calcParsFromExtentAndSpacing(const VP1HelperClassBase *, const double &extent, const double &spacing, const int &nmaxlimit, int &nmax, double &distmax)
Definition VP1Floor.cxx:30
static int nMax()
Definition VP1Floor.h:33

◆ updateColour()

void VP1Floor::Imp::updateColour ( )

Definition at line 149 of file VP1Floor.cxx.

150{
151 theclass->messageVerbose("Updating packed colour");
152 if (!sep||sep->getNumChildren()<1)
153 return;
154 SoNode * n = sep->getChild(0);
155 if (!n||n->getTypeId()!=SoLineSet::getClassTypeId())
156 return;
157 SoLineSet * line = static_cast<SoLineSet*>(n);
158 SoVertexProperty * vertices = static_cast<SoVertexProperty *>(line->vertexProperty.getValue());
159 if (!vertices)
160 return;
161 vertices->orderedRGBA = colourAndTransp.getPackedValue();
162}

Member Data Documentation

◆ attachSep

SoSeparator* VP1Floor::Imp::attachSep

Definition at line 51 of file VP1Floor.cxx.

◆ colourAndTransp

SbColor4f VP1Floor::Imp::colourAndTransp

Definition at line 54 of file VP1Floor.cxx.

◆ extent

double VP1Floor::Imp::extent

Definition at line 55 of file VP1Floor.cxx.

◆ sep

SoSeparator* VP1Floor::Imp::sep

Definition at line 59 of file VP1Floor.cxx.

◆ shown

bool VP1Floor::Imp::shown

Definition at line 53 of file VP1Floor.cxx.

◆ spacing

double VP1Floor::Imp::spacing

Definition at line 56 of file VP1Floor.cxx.

◆ theclass

VP1Floor* VP1Floor::Imp::theclass

Definition at line 50 of file VP1Floor.cxx.

◆ vertpos

double VP1Floor::Imp::vertpos

Definition at line 57 of file VP1Floor.cxx.


The documentation for this class was generated from the following file: