1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-03 14:10:33 +03:00

0024762: Visualization - new interactive object AIS_ColoredShape with customized subshapes presentations

AIS_Shape, ::SetColor(), ::SetMaterial(), ::SetTransparency(), ::SetWidth() - improve consistency.
Setup color for marker aspect as well.
vaspects - new command superseeds vsetcolor, vsetmaterial, vsettransparancy, vsetwidth
and their unset analogs. Improve syntax and arguments validation.
OpenGl_AspectMarker::SetAspect() - do not reset myMarkerSize when sprite is unchanged.
Extend NCollection_IndexedDataMap - Iterator::Key() and FindFromKey() with value copying.

Add test case bugs vis bug24762_coloredshape.
This commit is contained in:
kgv
2014-04-03 16:29:23 +04:00
committed by apn
parent 8abada55ca
commit ad3217cd8d
15 changed files with 2012 additions and 825 deletions

View File

@@ -361,6 +361,32 @@ void StdPrs_ShadedShape::Add (const Handle(Prs3d_Presentation)& thePresentation,
Standard_False, aDummy, aDummy, aDummy);
}
// =======================================================================
// function : Tessellate
// purpose :
// =======================================================================
void StdPrs_ShadedShape::Tessellate (const TopoDS_Shape& theShape,
const Handle (Prs3d_Drawer)& theDrawer)
{
// Check if it is possible to avoid unnecessary recomputation
// of shape triangulation
Standard_Real aDeflection = GetDeflection (theShape, theDrawer);
if (BRepTools::Triangulation (theShape, aDeflection))
{
return;
}
// retrieve meshing tool from Factory
BRepTools::Clean (theShape);
Handle(BRepMesh_DiscretRoot) aMeshAlgo = BRepMesh_DiscretFactory::Get().Discret (theShape,
aDeflection,
theDrawer->HLRAngle());
if (!aMeshAlgo.IsNull())
{
aMeshAlgo->Perform();
}
}
// =======================================================================
// function : Add
// purpose :
@@ -411,22 +437,8 @@ void StdPrs_ShadedShape::Add (const Handle (Prs3d_Presentation)& thePresentation
StdPrs_WFShape::Add (thePresentation, theShape, theDrawer);
}
}
Standard_Real aDeflection = GetDeflection (theShape, theDrawer);
// Check if it is possible to avoid unnecessary recomputation
// of shape triangulation
if (!BRepTools::Triangulation (theShape, aDeflection))
{
BRepTools::Clean (theShape);
// retrieve meshing tool from Factory
Handle(BRepMesh_DiscretRoot) aMeshAlgo = BRepMesh_DiscretFactory::Get().Discret (theShape,
aDeflection,
theDrawer->HLRAngle());
if (!aMeshAlgo.IsNull())
aMeshAlgo->Perform();
}
Tessellate (theShape, theDrawer);
ShadeFromShape (theShape, thePresentation, theDrawer,
theHasTexels, theUVOrigin, theUVRepeat, theUVScale);