#include <GEOMUtils.hxx>
-#include <Basics_OCCTVersion.hxx>
-
// Open CASCADE Includes
#include <AIS_InteractiveContext.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <Graphic3d_AspectText3d.hxx>
+#include <Prs3d.hxx>
#include <Prs3d_Arrow.hxx>
#include <Prs3d_IsoAspect.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <SelectMgr_IndexedMapOfOwner.hxx>
#include <SelectMgr_Selection.hxx>
#include <StdPrs_ShadedShape.hxx>
+#include <StdPrs_ToolTriangulatedShape.hxx>
#include <StdSelect_BRepOwner.hxx>
#include <StdSelect_DisplayMode.hxx>
#include <TColStd_IndexedMapOfInteger.hxx>
#include <gp_Dir.hxx>
#include <gp_Pnt.hxx>
#include <gp_Vec.hxx>
-
-#if OCC_VERSION_LARGE > 0x06070200
#include <Prs3d_VertexDrawMode.hxx>
-#endif
-
-#if OCC_VERSION_MAJOR < 7
- #include <StdPrs_WFDeflectionShape.hxx>
-#else
- #include <StdPrs_WFShape.hxx>
-#endif
+#include <StdPrs_WFShape.hxx>
#include <SalomeApp_Tools.h>
#include <SUIT_Session.h>
#include <SUIT_ResourceMgr.h>
-OCCT_IMPLEMENT_STANDARD_RTTIEXT(GEOM_AISShape, SALOME_AISShape)
+IMPLEMENT_STANDARD_RTTIEXT(GEOM_AISShape, SALOME_AISShape)
GEOM_AISShape::TopLevelDispMode GEOM_AISShape::myTopLevelDm = GEOM_AISShape::TopKeepCurrent;
Quantity_Color GEOM_AISShape::myTopLevelColor;
Handle(SelectMgr_Selection) sel = theObj->Selection( m );
for ( sel->Init(); sel->More(); sel->Next() ) {
-#if OCC_VERSION_LARGE > 0x06080100
const Handle(SelectMgr_SensitiveEntity) aHSenEntity = sel->Sensitive();
if( aHSenEntity.IsNull() )
continue;
Handle(SelectBasics_SensitiveEntity) entity = aHSenEntity->BaseSensitive();
-#else
- Handle(SelectBasics_SensitiveEntity) entity = sel->Sensitive();
-#endif
if ( entity.IsNull() )
continue;
Handle(SelectMgr_EntityOwner) owner =
return myName.ToCString();
}
+Standard_Boolean GEOM_AISShape::AcceptDisplayMode(const Standard_Integer theMode) const
+{
+ return theMode >= Wireframe && theMode <= CustomHighlight;
+}
+
void GEOM_AISShape::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
const Handle(Prs3d_Presentation)& aPrs,
const Standard_Integer aMode)
-{
+{
if (IsInfinite()) aPrs->SetInfiniteState(Standard_True); //pas de prise en compte lors du FITALL
Handle(AIS_InteractiveContext) anIC = GetContext();
bool anIsColorField = anIsField && myFieldDataType != GEOM::FDT_String;
bool anIsTextField = anIsField && myFieldDataType == GEOM::FDT_String;
-#if OCC_VERSION_LARGE > 0x06070200
if (isShowVertices())
myDrawer->SetVertexDrawMode(Prs3d_VDM_All);
-#endif
// StdSelect_DisplayMode d = (StdSelect_DisplayMode) aMode;
bool isTopLev = isTopLevel() && switchTopLevel();
switch (aMode) {
case Wireframe:
+ // Begin 0023271: [CEA 1823] Deflection Coefficient not taken into account in wireframe
+ {
+ StdPrs_ToolTriangulatedShape::ClearOnOwnDeflectionChange (myshape, myDrawer, Standard_True);
+
+ // After this call if type of deflection is relative
+ // computed deflection coefficient is stored as absolute.
+ Prs3d::GetDeflection (myshape, myDrawer);
+ }
+ // End 0023271
case CustomHighlight:
{
if(isTopLev) {
if( !isTopLev && anIsColorField && myFieldDimension == 1 )
drawField( aPrs, false, aMode == CustomHighlight );
else
-#if OCC_VERSION_MAJOR < 7
- StdPrs_WFDeflectionShape::Add(aPrs,myshape,myDrawer);
-#else
StdPrs_WFShape::Add(aPrs,myshape,myDrawer);
-#endif
break;
}
case Shading:
}
case TexturedShape:
{
-#ifdef USE_TEXTURED_SHAPE
- AIS_TexturedShape::Compute(aPresentationManager, aPrs, aMode);
-#else
- AIS_Shape::Compute(aPresentationManager, aPrs, aMode);
-#endif
+ shadingMode(aPresentationManager, aPrs, Shading);
+ break;
}
}
if (isShowVectors())
{
// PAL12113: AIS_Shape::Compute() works correctly with shapes containing no faces
//StdPrs_ShadedShape::Add(aPrs,myshape,myDrawer);
-#ifdef USE_TEXTURED_SHAPE
- AIS_TexturedShape::Compute(aPresentationManager, aPrs, aMode);
-#else
- AIS_Shape::Compute(aPresentationManager, aPrs, aMode);
-#endif
+ SALOME_AISShape::Compute(aPresentationManager, aPrs, aMode);
}
}
anAspectText3d->SetColor( myLabelColor );
aGroup->SetPrimitivesAspect( anAspectText3d );
- aGroup->Text( aString.toLatin1().constData(), aVertex, 14 );
+ aGroup->Text( aString.toUtf8().constData(), aVertex, 14 );
}
}
else
{
Quantity_Color aColor( aQColor.redF(), aQColor.greenF(), aQColor.blueF(), Quantity_TOC_RGB );
+ SetCustomColor( aSubShape, aColor );
if( myFieldDimension == 0 )
{
TopoDS_Vertex aVertexShape = TopoDS::Vertex( aSubShape );
myDrawer->WireAspect()->SetWidth( myOwnWidth );
else
myDrawer->WireAspect()->SetWidth( myOwnWidth + 4 );
-#if OCC_VERSION_MAJOR < 7
- StdPrs_WFDeflectionShape::Add( thePrs, aSubShape, myDrawer );
-#else
+ /*
StdPrs_WFShape::Add( thePrs, aSubShape, myDrawer );
-#endif
+ */
}
else if( myFieldDimension == 2 ||
myFieldDimension == 3 ||
myFieldDimension == -1 )
{
- myDrawer->ShadingAspect()->SetColor( aColor );
- StdPrs_ShadedShape::Add( thePrs, aSubShape, myDrawer );
+ //Handle(Prs3d_ShadingAspect) anAspect = new Prs3d_ShadingAspect();
+ //anAspect->SetColor( aColor );
+ //myDrawer->SetShadingAspect( anAspect );
+ //StdPrs_ShadedShape::Add( thePrs, aSubShape, myDrawer );
}
}
}
}
+
+ SALOME_AISShape::Compute( Handle(PrsMgr_PresentationManager3d)(),
+ thePrs, AIS_Shaded );
}
void GEOM_AISShape::drawName( const Handle(Prs3d_Presentation)& thePrs )