}
else
{
- const Handle(Select3D_SensitiveEntity)& aPickedEntity = myMainSel->PickedEntity (thePicked);
- SelectBasics_PickResult aPickResult;
- aPickedEntity->Matches (myMainSel->GetManager(), aPickResult);
- Graphic3d_Vec3 aNormal = aPickResult.SurfaceNormal();
+ const SelectMgr_SortCriterion& aPickedData = myMainSel->PickedData (thePicked);
+ Graphic3d_Vec3 aNormal = aPickedData.Normal;
aNormal.Normalize();
- myImage->SetPixelColor (theCol, theRow, Quantity_ColorRGBA (aNormal.x() * 0.5f + 0.5f,
- aNormal.y() * 0.5f + 0.5f,
- aNormal.z() * 0.5f + 0.5f, 1.0f));
+ if (aNormal.Modulus() > 0.0f)
+ {
+ myImage->SetPixelColor (theCol, theRow, Quantity_ColorRGBA (aNormal.x() * 0.5f + 0.5f,
+ aNormal.y() * 0.5f + 0.5f,
+ aNormal.z() * 0.5f + 0.5f, 1.0f));
+ }
+ else
+ {
+ myImage->SetPixelColor (theCol, theRow, Quantity_NOC_BLACK);
+ }
}
}
};
Standard_Integer theArgsNb,
const char** theArgVec)
{
- if (theArgsNb < 2)
- {
- Message::SendFail() << "Syntax error: wrong number arguments for '" << theArgVec[0] << "'";
- return 1;
- }
-
const Handle(AIS_InteractiveContext)& aContext = ViewerTest::GetAISContext();
const Handle(V3d_View)& aView = ViewerTest::CurrentView();
if (aContext.IsNull())
{
if (++anArgIter >= theArgsNb)
{
- Message::SendFail ("Syntax error: wrong number parameters of flag '-depth'");
+ Message::SendFail ("Syntax error: wrong number parameters of flag '-type'");
return 1;
}
aType = StdSelect_TypeOfSelectionImage_NormalizedDepth;
anImgFormat = Image_Format_GrayF;
}
- if (aValue == "depthinverted"
- || aValue == "normdepthinverted"
- || aValue == "normalizeddepthinverted"
- || aValue == "inverted")
+ else if (aValue == "depthinverted"
+ || aValue == "normdepthinverted"
+ || aValue == "normalizeddepthinverted"
+ || aValue == "inverted")
{
aType = StdSelect_TypeOfSelectionImage_NormalizedDepthInverted;
anImgFormat = Image_Format_GrayF;
{
aType = StdSelect_TypeOfSelectionImage_SurfaceNormal;
}
+ else
+ {
+ Message::SendFail() << "Syntax error: unknown type '" << aValue << "'";
+ return 1;
+ }
}
else if (aParam == "-picked"
|| aParam == "-pickeddepth"
__FILE__, VSelectionProperties, group);
theCommands.Add ("vseldump",
- "vseldump file -type {depth|unnormDepth|object|owner|selMode|entity}=depth -pickedIndex Index=1"
+ "vseldump file -type {depth|unnormDepth|object|owner|selMode|entity|surfNormal}=depth -pickedIndex Index=1"
"\n\t\t: [-xrPose base|head=base]"
"\n\t\t: Generate an image based on detection results:"
"\n\t\t: depth normalized depth values"