MeVisLab Toolbox Reference
mlPCLClusterStatisticsClusterSubGraph.h
Go to the documentation of this file.
1// Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2// **InsertLicense** code author="Wolf Spindler"
3//----------------------------------------------------------------------------------
6
13*/
14//----------------------------------------------------------------------------------
15#pragma once
16
18
20#include <Inventor/nodes/SoBaseColor.h>
21#include <Inventor/nodes/SoDrawStyle.h>
22#include <Inventor/nodes/SoLineSet.h>
23#include <Inventor/nodes/SoSeparator.h>
24#include <Inventor/nodes/SoSphere.h>
25#include <Inventor/nodes/SoSwitch.h>
26#include <Inventor/nodes/SoTranslation.h>
27#include <Inventor/nodes/SoVertexProperty.h>
30
31ML_START_NAMESPACE
32
33//----------------------------------------------------------------------------------
35//----------------------------------------------------------------------------------
37public:
39 enum { NumOrientationLines = 3 };
40
43 {
44 clusterRoot = new SoSeparator();
45 clusterRoot->ref();
46
47 SoSeparator *sep1 = new SoSeparator();
48 clusterRoot->addChild(sep1);
49
50 soPlaneIntersectionSwitch = new SoSwitch();
51 sep1->addChild(soPlaneIntersectionSwitch);
52
53 soPlaneIntersectionTranslation = new SoTranslation();
55
56 soPlaneIntersectionColorSwitch = new SoSwitch();
58
59 soPlaneIntersectionBaseColor = new SoBaseColor();
61
62 soPlaneIntersectionSphere = new SoSphere();
64
65
66 // Centre of Gravity:
67 SoSeparator *sep2 = new SoSeparator();
68 clusterRoot->addChild(sep2);
69
70 soCenterOfGravitySwitch = new SoSwitch();
71 sep2->addChild(soCenterOfGravitySwitch);
72
73 soCenterOfGravityTranslation = new SoTranslation();
75
76 soCenterOfGravityColorSwitch = new SoSwitch();
78
79 soCenterOfGravityBaseColor = new SoBaseColor();
81
82 soCenterOfGravitySphere = new SoSphere();
84
85 // Orientation lines:
86 // Use CenterOfGravity colour also for line set.
88
89 SoSeparator *sep3 = new SoSeparator();
90 clusterRoot->addChild(sep3);
91
92 for (size_t c=0; c < NumOrientationLines; ++c){
93 soClusterOrientationLineSwitch[c] = new SoSwitch();
94 sep3->addChild(soClusterOrientationLineSwitch[c]);
95
96 soVertexProperty[c] = new SoVertexProperty();
98
99 soLineSet[c] = new SoLineSet();
101 }
102
103 // Cluster to plane intersection line:
104 SoSeparator *sep4 = new SoSeparator();
105 clusterRoot->addChild(sep4);
106
107 soDrawStyleClusterToPlane = new SoDrawStyle();
108 sep4->addChild(soDrawStyleClusterToPlane);
109 soDrawStyleClusterToPlane->linePattern.setValue(static_cast<MLuint16>(0x1111));
110
113
114 soVertexPropertyClusterToPlane = new SoVertexProperty();
116
117 soLineSetClusterToPlane = new SoLineSet();
119 }
120
123 {
124 clusterRoot->unref();
125 }
126
128 SoSeparator *clusterRoot;
129
137
145
149
152
155
159
165
166};
167
168ML_END_NAMESPACE
Disables warnings from PCL headers which otherwise cannot be avoided.
Restores disabled warnings from PCL headers which otherwise cannot be avoided.
SoSwitch * soCenterOfGravitySwitch
Centre of Gravity.
SoSwitch * soClusterToPlaneIntersectionLineSwitch
Cluster to plane intersection line.
~ClusterSubGraph()
Destructor which removed entire node graph just by dereferencing the root.
SoVertexProperty * soVertexProperty[NumOrientationLines]
SoVertexProperty with coordinates for orientation lines.
SoLineSet * soLineSet[NumOrientationLines]
SoLineSetSet to display orientation lines.
SoSeparator * clusterRoot
Root to be appended to parent graph.
SoSwitch * soPlaneIntersectionSwitch
Plane intersections.
ClusterSubGraph()
Constructor which creates the whole subgraph with all orientation nodes.
SoSwitch * soClusterOrientationLineSwitch[NumOrientationLines]
Switch activating display of each orientation lines.
Displays PCLClusterStatistics results in Open Inventor scene.
unsigned short MLuint16
Definition mlTypeDefs.h:141