#include <PrsMgr_ModedPresentation.hxx>
#include <PrsMgr_Presentations.hxx>
#include <Select3D_SensitiveBox.hxx>
+#include <Select3D_SensitivePrimitiveArray.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <SelectMgr_Selection.hxx>
-#include <StdPrs_WFDeflectionRestrictedFace.hxx>
+#include <StdPrs_BndBox.hxx>
-IMPLEMENT_STANDARD_HANDLE (AIS_PointCloud, AIS_InteractiveObject)
-IMPLEMENT_STANDARD_RTTIEXT(AIS_PointCloud, AIS_InteractiveObject)
+
+IMPLEMENT_STANDARD_RTTIEXT(AIS_PointCloud,AIS_InteractiveObject)
//==================================================
// Function: AIS_PointCloud
//==================================================
AIS_PointCloud::AIS_PointCloud()
{
+ // override default point style to Aspect_TOM_POINT
+ myDrawer->SetPointAspect (new Prs3d_PointAspect (Aspect_TOM_POINT, Quantity_NOC_YELLOW, 1.0));
+
SetDisplayMode (AIS_PointCloud::DM_Points);
SetHilightMode (AIS_PointCloud::DM_BndBox);
}
myBndBox = getBoundingBox (myPoints);
}
-//=======================================================================
-//function : SetColor
-//purpose :
-//=======================================================================
-void AIS_PointCloud::SetColor (const Quantity_NameOfColor theColor)
-{
- SetColor (Quantity_Color (theColor));
-}
-
//=======================================================================
//function : SetColor
//purpose :
}
const Handle(Prs3d_Presentation)& aPrs = aPrsModed.Presentation()->Presentation();
-
- // Set aspects for presentation
- aPrs->SetPrimitivesAspect (aPointAspect);
- aPrs->SetPrimitivesAspect (anAreaAspect);
-
- // Go through all groups to change color for all primitives
for (Graphic3d_SequenceOfGroup::Iterator aGroupIt (aPrs->Groups()); aGroupIt.More(); aGroupIt.Next())
{
const Handle(Graphic3d_Group)& aGroup = aGroupIt.Value();
}
else
{
- Quantity_Color aColor = Quantity_NOC_YELLOW;
- Aspect_TypeOfMarker aType = Aspect_TOM_POINT;
- Standard_Real aScale = 1.0;
- if (myDrawer->HasLink())
- {
- myDrawer->Link()->PointAspect()->Aspect()->Values (aColor, aType, aScale);
- }
- myDrawer->PointAspect()->SetColor (aColor);
+ myDrawer->PointAspect()->SetColor (myDrawer->HasLink()
+ ? myDrawer->Link()->PointAspect()->Aspect()->Color()
+ : Quantity_Color (Quantity_NOC_YELLOW));
}
if (HasMaterial()
if (IsTransparent())
{
Standard_Real aTransp = myDrawer->ShadingAspect()->Transparency (myCurrentFacingModel);
- aMat.SetTransparency (aTransp);
+ aMat.SetTransparency (Standard_ShortReal(aTransp));
}
myDrawer->ShadingAspect()->SetMaterial (aMat, myCurrentFacingModel);
}
}
const Handle(Prs3d_Presentation)& aPrs = aPrsModed.Presentation()->Presentation();
- aPrs->SetPrimitivesAspect (anAreaAsp);
- aPrs->SetPrimitivesAspect (aMarkerAsp);
for (Graphic3d_SequenceOfGroup::Iterator aGroupIt (aPrs->Groups()); aGroupIt.More(); aGroupIt.Next())
{
const Handle(Graphic3d_Group)& aGroup = aGroupIt.Value();
}
}
-//=======================================================================
-//function : SetMaterial
-//purpose :
-//=======================================================================
-void AIS_PointCloud::SetMaterial (const Graphic3d_NameOfMaterial theMatName)
-{
- SetMaterial (Graphic3d_MaterialAspect (theMatName));
-}
-
//=======================================================================
//function : SetMaterial
//purpose :
myDrawer->ShadingAspect()->SetMaterial (theMat, myCurrentFacingModel);
if (HasColor())
{
- myDrawer->ShadingAspect()->SetColor (myOwnColor, myCurrentFacingModel);
+ myDrawer->ShadingAspect()->SetColor (myDrawer->Color(), myCurrentFacingModel);
}
- myDrawer->ShadingAspect()->SetTransparency (myTransparency, myCurrentFacingModel);
+ myDrawer->ShadingAspect()->SetTransparency (myDrawer->Transparency(), myCurrentFacingModel);
// modify shading presentation without re-computation
const PrsMgr_Presentations& aPrsList = Presentations();
}
const Handle(Prs3d_Presentation)& aPrs = aPrsModed.Presentation()->Presentation();
- aPrs->SetPrimitivesAspect (anAreaAsp);
for (Graphic3d_SequenceOfGroup::Iterator aGroupIt (aPrs->Groups()); aGroupIt.More(); aGroupIt.Next())
{
const Handle(Graphic3d_Group)& aGroup = aGroupIt.Value();
myCurrentFacingModel);
if (HasColor())
{
- myDrawer->ShadingAspect()->SetColor (myOwnColor, myCurrentFacingModel);
- myDrawer->ShadingAspect()->SetTransparency (myTransparency, myCurrentFacingModel);
+ myDrawer->ShadingAspect()->SetColor (myDrawer->Color(), myCurrentFacingModel);
+ myDrawer->ShadingAspect()->SetTransparency (myDrawer->Transparency(), myCurrentFacingModel);
}
}
else
}
const Handle(Prs3d_Presentation)& aPrs = aPrsModed.Presentation()->Presentation();
- aPrs->SetPrimitivesAspect (anAreaAsp);
for (Graphic3d_SequenceOfGroup::Iterator aGroupIt (aPrs->Groups()); aGroupIt.More(); aGroupIt.Next())
{
const Handle(Graphic3d_Group)& aGroup = aGroupIt.Value();
const Handle(Prs3d_Presentation)& thePrs,
const Standard_Integer theMode)
{
- thePrs->Clear();
switch (theMode)
{
case AIS_PointCloud::DM_Points:
return;
}
- Handle(Graphic3d_AspectMarker3d) aMarkerAspect = myDrawer->PointAspect()->Aspect();
- if (!myDrawer->HasOwnPointAspect())
- {
- aMarkerAspect->SetType (Aspect_TOM_POINT);
- }
-
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup (thePrs);
- aGroup->SetGroupPrimitivesAspect (aMarkerAspect);
+ aGroup->SetGroupPrimitivesAspect (myDrawer->PointAspect()->Aspect());
+ aGroup->SetGroupPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
aGroup->AddPrimitiveArray (aPoints);
break;
}
return;
}
- StdPrs_WFDeflectionRestrictedFace::AddBox (thePrs, aBndBox, myDrawer);
+ StdPrs_BndBox::Add (thePrs, aBndBox, myDrawer);
break;
}
}
//purpose :
//=======================================================================
void AIS_PointCloud::ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
- const Standard_Integer /*theMode*/)
+ const Standard_Integer theMode)
{
+ Handle(SelectMgr_EntityOwner) anOwner = new SelectMgr_EntityOwner (this);
+ switch (theMode)
+ {
+ case SM_Points:
+ {
+ const Handle(Graphic3d_ArrayOfPoints) aPoints = GetPoints();
+ if (!aPoints.IsNull()
+ && !aPoints->Attributes().IsNull())
+ {
+ Handle(Select3D_SensitivePrimitiveArray) aSensitive = new Select3D_SensitivePrimitiveArray (anOwner);
+ aSensitive->SetSensitivityFactor (8);
+ aSensitive->InitPoints (aPoints->Attributes(), aPoints->Indices(), TopLoc_Location());
+ aSensitive->BVH();
+ theSelection->Add (aSensitive);
+ return;
+ }
+ break;
+ }
+ case SM_BndBox:
+ {
+ break;
+ }
+ default:
+ {
+ return;
+ }
+ }
+
Bnd_Box aBndBox = GetBoundingBox();
if (aBndBox.IsVoid())
{
return;
}
-
- Handle(SelectMgr_EntityOwner) anOwner = new SelectMgr_EntityOwner (this);
Handle(Select3D_SensitiveBox) aSensBox = new Select3D_SensitiveBox (anOwner, aBndBox);
theSelection->Add (aSensBox);
}