77{
78 theclass->messageVerbose(
"(Re)building 3D objects");
79
81 sep->removeAllChildren();
82 } else {
83 sep =
new SoSeparator;
85 }
86
87 const bool save =
sep->enableNotify(
false);
88
89 int nmax;
double distmax;
92 distmax = 10*SYSTEM_OF_UNITS::m;
93 theclass->message(
"ERROR: Problems calculating nmax/distmax.");
94 }
95
96 SoVertexProperty * grid_cartesian_vertices = new SoVertexProperty();
97
98 int ivert(0);
99 int nsublines(0);
100
101
102 for (
int ix = -
nmax; ix<=
nmax; ++ix)
103 for (
int iz = -
nmax; iz<=
nmax; ++iz) {
106 grid_cartesian_vertices->vertex.set1Value(ivert++,
x,-distmax,
z);
107 grid_cartesian_vertices->vertex.set1Value(ivert++,
x,+distmax,
z);
108 ++nsublines;
109 }
110
111
112 for (
int iy = -
nmax; iy<=
nmax; ++iy) {
114 for (
int ix = -
nmax; ix<=
nmax; ++ix) {
116 grid_cartesian_vertices->vertex.set1Value(ivert++,
x,
y,-distmax);
117 grid_cartesian_vertices->vertex.set1Value(ivert++,
x,
y,+distmax);
118 ++nsublines;
119 }
120 for (
int iz = -
nmax; iz<=
nmax; ++iz) {
122 grid_cartesian_vertices->vertex.set1Value(ivert++,-distmax,
y,
z);
123 grid_cartesian_vertices->vertex.set1Value(ivert++,+distmax,
y,
z);
124 ++nsublines;
125 }
126 }
127
128 grid_cartesian_vertices->materialBinding=SoMaterialBinding::OVERALL;
129 grid_cartesian_vertices->normalBinding=SoNormalBinding::OVERALL;
130 SoLineSet *
line =
new SoLineSet();
131 line->numVertices.enableNotify(FALSE);
132 line->numVertices.setNum(nsublines);
133 for (
int i=0;
i<nsublines;++
i)
134 line->numVertices.set1Value(i,2);
135 line->vertexProperty = grid_cartesian_vertices;
136 line->numVertices.enableNotify(TRUE);
137 line->numVertices.touch();
138
141
142 if (save) {
143 sep->enableNotify(
true);
145 }
146
147}
static bool calcParsFromExtentAndSpacing(const VP1HelperClassBase *, const double &extent, const double &spacing, const int &nmaxlimit, int &nmax, double &distmax)