@@ -26,6 +26,7 @@ GeometricalAnalysisTools::ErrorCode GeometricalAnalysisTools::ComputeCharactersi
2626 int subOption,
2727 GenericIndexedCloudPersist* cloud,
2828 PointCoordinateType kernelRadius,
29+ const CCVector3* roughnessUpDir/* =nullptr*/ ,
2930 GenericProgressCallback* progressCb/* =nullptr*/ ,
3031 DgmOctree* inputOctree/* =nullptr*/ )
3132{
@@ -104,7 +105,8 @@ GeometricalAnalysisTools::ErrorCode GeometricalAnalysisTools::ComputeCharactersi
104105 {
105106 static_cast <void *>(&c),
106107 static_cast <void *>(&subOption),
107- static_cast <void *>(&kernelRadius)
108+ static_cast <void *>(&kernelRadius),
109+ static_cast <void *>(const_cast <CCVector3*>(roughnessUpDir))
108110 };
109111
110112 ErrorCode result = NoError;
@@ -165,12 +167,13 @@ GeometricalAnalysisTools::ErrorCode GeometricalAnalysisTools::ComputeCharactersi
165167
166168bool GeometricalAnalysisTools::ComputeGeomCharacteristicAtLevel (const DgmOctree::octreeCell& cell,
167169 void ** additionalParameters,
168- NormalizedProgress* nProgress/* =0 */ )
170+ NormalizedProgress* nProgress/* =nullptr */ )
169171{
170172 // parameters
171- GeomCharacteristic c = *static_cast <GeomCharacteristic*>(additionalParameters[0 ]);
172- int subOption = *static_cast <Neighbourhood::CurvatureType*>(additionalParameters[1 ]);
173- PointCoordinateType radius = *static_cast <PointCoordinateType*>(additionalParameters[2 ]);
173+ GeomCharacteristic c = *static_cast <GeomCharacteristic*>(additionalParameters[0 ]);
174+ int subOption = *static_cast <Neighbourhood::CurvatureType*>(additionalParameters[1 ]);
175+ PointCoordinateType radius = *static_cast <PointCoordinateType*>(additionalParameters[2 ]);
176+ const CCVector3* roughnessUpDir = static_cast <const CCVector3*>(additionalParameters[3 ]);
174177
175178 // structure for nearest neighbors search
176179 DgmOctree::NearestNeighboursSphericalSearchStruct nNSS;
@@ -257,7 +260,7 @@ bool GeometricalAnalysisTools::ComputeGeomCharacteristicAtLevel(const DgmOctree:
257260
258261 DgmOctreeReferenceCloud neighboursCloud (&nNSS.pointsInNeighbourhood , neighborCount - 1 ); // we don't take the query point into account!
259262 Neighbourhood Z (&neighboursCloud);
260- value = Z.computeRoughness (nNSS.queryPoint );
263+ value = Z.computeRoughness (nNSS.queryPoint , roughnessUpDir );
261264
262265 // swap the points back to their original position (DGM: not necessary in this case)
263266 // if (localIndex+1 < neighborCount)
0 commit comments