ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
VP1CoordinateAxes::Imp Class Reference
Collaboration diagram for VP1CoordinateAxes::Imp:

Public Member Functions

 Imp (VP1CoordinateAxes *, SoMaterial *xmat, SoMaterial *ymat, SoMaterial *zmat, SoSeparator *attachsep)
 
void updateFields ()
 
void ensureInit3DObjects ()
 

Public Attributes

VP1CoordinateAxestheclass
 
SoMaterial * materialXAxis
 
SoMaterial * materialYAxis
 
SoMaterial * materialZAxis
 
SoSeparator * attachSep
 
bool shown
 
SbVec3f origo
 
double axislength
 
double relaxisthick
 
SoSeparator * sep
 
SoTranslation * overall_translation
 
SoSphere * alternative_Sphere
 
SoSeparator * singleaxis_sep
 
SoCylinder * singleaxis_cyl
 
SoCone * singleaxis_cone
 
SoTranslation * singleaxis_cyltranslation
 
SoTranslation * singleaxis_conetranslation
 

Detailed Description

Definition at line 27 of file VP1CoordinateAxes.cxx.

Constructor & Destructor Documentation

◆ Imp()

VP1CoordinateAxes::Imp::Imp ( VP1CoordinateAxes tc,
SoMaterial *  xmat,
SoMaterial *  ymat,
SoMaterial *  zmat,
SoSeparator *  attachsep 
)

Definition at line 82 of file VP1CoordinateAxes.cxx.

83  : theclass(tc), materialXAxis(xmat), materialYAxis(ymat), materialZAxis(zmat), attachSep(as), shown(false),
84  origo(SbVec3f(0,0,0)), axislength(1), relaxisthick(0.1),
87 {
88  materialXAxis->ref();
89  materialYAxis->ref();
90  materialZAxis->ref();
91  attachSep->ref();
92 }

Member Function Documentation

◆ ensureInit3DObjects()

void VP1CoordinateAxes::Imp::ensureInit3DObjects ( )

Definition at line 95 of file VP1CoordinateAxes.cxx.

96 {
97  if (sep)
98  return;
99  theclass->messageVerbose("Building 3D objects");
100  sep = new SoSeparator; sep->ref();
101 
102  singleaxis_sep = new SoSeparator; singleaxis_sep->ref();
104  singleaxis_cyl = new SoCylinder; singleaxis_sep->addChild(singleaxis_cyl);
106  singleaxis_cone = new SoCone; singleaxis_sep->addChild(singleaxis_cone);
107 
108  overall_translation = new SoTranslation;
109 
110  sep->addChild(overall_translation);
111 
112  #if defined BUILDVP1LIGHT
113  const bool alternativeRep = VP1QtUtils::expertSettingIsOn("general","ExpertSettings/VP1_GUIDES_SPHERE_INSTEAD_OF_COORDAXES");
114  #else
115  const bool alternativeRep = VP1QtUtils::environmentVariableIsOn("VP1_GUIDES_SPHERE_INSTEAD_OF_COORDAXES");
116  #endif
117 
118  if (alternativeRep) {
119  sep->addChild(materialXAxis);
120  alternative_Sphere = new SoSphere;
121  sep->addChild(alternative_Sphere);
122  return;
123  }
124 
125 
126  sep->addChild(materialYAxis);
127  sep->addChild(singleaxis_sep);//Single-axis points towards y by default.
128 
129  SoRotationXYZ * rotx = new SoRotationXYZ;
130  rotx->axis.setValue(SoRotationXYZ::Z);
131  rotx->angle.setValue(-0.5*M_PI);
132  sep->addChild(rotx);
133 
134  sep->addChild(materialXAxis);
135  sep->addChild(singleaxis_sep);//Single-axis points towards y by default.
136 
137 
138  SoRotationXYZ * rotz = new SoRotationXYZ;
139  rotz->axis.setValue(SoRotationXYZ::X);
140  rotz->angle.setValue(0.5*M_PI);
141  sep->addChild(rotz);
142 
143  sep->addChild(materialZAxis);
144  sep->addChild(singleaxis_sep);//Single-axis points towards y by default.
145 
146  singleaxis_cyl->parts.setValue(SoCylinder::SIDES|SoCylinder::BOTTOM);
147 }

◆ updateFields()

void VP1CoordinateAxes::Imp::updateFields ( )

Definition at line 150 of file VP1CoordinateAxes.cxx.

151 {
153  theclass->messageVerbose("Updating fields");
154 
155  const bool save = sep->enableNotify(false);
156 
157  const double cylradius = relaxisthick*fabs(axislength);
158  const double coneradius = 1.5*cylradius;
159  const double coneheight = 2.0*coneradius;
160  overall_translation->translation.setValue(origo);
161 
162  if (alternative_Sphere) {
163  alternative_Sphere->radius.setValue(fabs(axislength));
164  } else {
165  singleaxis_cyltranslation->translation.setValue(0.0,(axislength<0?0.0:0.5*fabs(axislength))-0.5*coneheight,0.0);
166  singleaxis_cyl->radius.setValue(cylradius);
167  singleaxis_cyl->height.setValue( (axislength<0 ? 2.0 : 1.0) * fabs(axislength) - coneheight );
168  singleaxis_conetranslation->translation.setValue(0.0,(axislength<0?1.0:0.5)*fabs(axislength),0.0);
169  singleaxis_cone->bottomRadius.setValue(coneradius);
170  singleaxis_cone->height.setValue(coneheight);
171  }
172 
173  if (save) {
174  sep->enableNotify(true);
175  sep->touch();
176  }
177 }

Member Data Documentation

◆ alternative_Sphere

SoSphere* VP1CoordinateAxes::Imp::alternative_Sphere

Definition at line 47 of file VP1CoordinateAxes.cxx.

◆ attachSep

SoSeparator* VP1CoordinateAxes::Imp::attachSep

Definition at line 38 of file VP1CoordinateAxes.cxx.

◆ axislength

double VP1CoordinateAxes::Imp::axislength

Definition at line 42 of file VP1CoordinateAxes.cxx.

◆ materialXAxis

SoMaterial* VP1CoordinateAxes::Imp::materialXAxis

Definition at line 35 of file VP1CoordinateAxes.cxx.

◆ materialYAxis

SoMaterial* VP1CoordinateAxes::Imp::materialYAxis

Definition at line 36 of file VP1CoordinateAxes.cxx.

◆ materialZAxis

SoMaterial* VP1CoordinateAxes::Imp::materialZAxis

Definition at line 37 of file VP1CoordinateAxes.cxx.

◆ origo

SbVec3f VP1CoordinateAxes::Imp::origo

Definition at line 41 of file VP1CoordinateAxes.cxx.

◆ overall_translation

SoTranslation* VP1CoordinateAxes::Imp::overall_translation

Definition at line 46 of file VP1CoordinateAxes.cxx.

◆ relaxisthick

double VP1CoordinateAxes::Imp::relaxisthick

Definition at line 43 of file VP1CoordinateAxes.cxx.

◆ sep

SoSeparator* VP1CoordinateAxes::Imp::sep

Definition at line 45 of file VP1CoordinateAxes.cxx.

◆ shown

bool VP1CoordinateAxes::Imp::shown

Definition at line 40 of file VP1CoordinateAxes.cxx.

◆ singleaxis_cone

SoCone* VP1CoordinateAxes::Imp::singleaxis_cone

Definition at line 50 of file VP1CoordinateAxes.cxx.

◆ singleaxis_conetranslation

SoTranslation* VP1CoordinateAxes::Imp::singleaxis_conetranslation

Definition at line 52 of file VP1CoordinateAxes.cxx.

◆ singleaxis_cyl

SoCylinder* VP1CoordinateAxes::Imp::singleaxis_cyl

Definition at line 49 of file VP1CoordinateAxes.cxx.

◆ singleaxis_cyltranslation

SoTranslation* VP1CoordinateAxes::Imp::singleaxis_cyltranslation

Definition at line 51 of file VP1CoordinateAxes.cxx.

◆ singleaxis_sep

SoSeparator* VP1CoordinateAxes::Imp::singleaxis_sep

Definition at line 48 of file VP1CoordinateAxes.cxx.

◆ theclass

VP1CoordinateAxes* VP1CoordinateAxes::Imp::theclass

Definition at line 34 of file VP1CoordinateAxes.cxx.


The documentation for this class was generated from the following file:
VP1CoordinateAxes::Imp::axislength
double axislength
Definition: VP1CoordinateAxes.cxx:42
NSWL1::SIDES
const std::vector< size_t > SIDES
Definition: tdr_compat_enum.h:20
VP1CoordinateAxes::Imp::singleaxis_cyltranslation
SoTranslation * singleaxis_cyltranslation
Definition: VP1CoordinateAxes.cxx:51
Monitored::Z
@ Z
Definition: HistogramFillerUtils.h:24
VP1HelperClassBase::messageVerbose
void messageVerbose(const QString &) const
Definition: VP1HelperClassBase.cxx:78
M_PI
#define M_PI
Definition: ActiveFraction.h:11
VP1CoordinateAxes::Imp::overall_translation
SoTranslation * overall_translation
Definition: VP1CoordinateAxes.cxx:46
VP1CoordinateAxes::Imp::theclass
VP1CoordinateAxes * theclass
Definition: VP1CoordinateAxes.cxx:34
VP1CoordinateAxes::Imp::relaxisthick
double relaxisthick
Definition: VP1CoordinateAxes.cxx:43
VP1CoordinateAxes::Imp::materialXAxis
SoMaterial * materialXAxis
Definition: VP1CoordinateAxes.cxx:35
Monitored::X
@ X
Definition: HistogramFillerUtils.h:24
checkTP.save
def save(self, fileName="./columbo.out")
Definition: checkTP.py:178
VP1CoordinateAxes::Imp::singleaxis_cyl
SoCylinder * singleaxis_cyl
Definition: VP1CoordinateAxes.cxx:49
VP1CoordinateAxes::Imp::sep
SoSeparator * sep
Definition: VP1CoordinateAxes.cxx:45
VP1CoordinateAxes::Imp::singleaxis_cone
SoCone * singleaxis_cone
Definition: VP1CoordinateAxes.cxx:50
VP1QtUtils::environmentVariableIsOn
static bool environmentVariableIsOn(const QString &name)
Definition: VP1QtUtils.cxx:127
VP1CoordinateAxes::Imp::attachSep
SoSeparator * attachSep
Definition: VP1CoordinateAxes.cxx:38
VP1QtUtils::expertSettingIsOn
static bool expertSettingIsOn(const QString &type, const QString &name)
Definition: VP1QtUtils.cxx:60
VP1CoordinateAxes::Imp::alternative_Sphere
SoSphere * alternative_Sphere
Definition: VP1CoordinateAxes.cxx:47
VP1CoordinateAxes::Imp::singleaxis_conetranslation
SoTranslation * singleaxis_conetranslation
Definition: VP1CoordinateAxes.cxx:52
VP1CoordinateAxes::Imp::ensureInit3DObjects
void ensureInit3DObjects()
Definition: VP1CoordinateAxes.cxx:95
VP1CoordinateAxes::Imp::singleaxis_sep
SoSeparator * singleaxis_sep
Definition: VP1CoordinateAxes.cxx:48
VP1CoordinateAxes::Imp::shown
bool shown
Definition: VP1CoordinateAxes.cxx:40
VP1CoordinateAxes::Imp::materialZAxis
SoMaterial * materialZAxis
Definition: VP1CoordinateAxes.cxx:37
VP1CoordinateAxes::Imp::origo
SbVec3f origo
Definition: VP1CoordinateAxes.cxx:41
VP1CoordinateAxes::Imp::materialYAxis
SoMaterial * materialYAxis
Definition: VP1CoordinateAxes.cxx:36