mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0025695: Visualization, AIS_InteractiveContext - define default HilightMode
AIS_InteractiveContext - removed the following unused properties: - PreSelectionColor(), DefaultColor(), WasCurrentTouched(), ZDetection(). AIS_InteractiveObject - removed unused property SelectionPriority(). Prs3d_Drawer - removed properties HighlightStyle() and SelectionStyle(). Graphic3d_HighlightStyle has been superseded by Prs3d_Drawer inheriting from new class Graphic3d_PresentationAttributes. Graphic3d_PresentationAttributes (as Graphic3d_HighlightStyle replacement) has been extended with new properties: - ZLayer() defining Z-Layer for highlighting presentation. - DisplayMode() defining display mode for highlighting. StdSelect_BRepSelectionTool methods have been corrected to take SelectMgr_EntityOwner instead of StdSelect_BRepOwner. StdSelect_Shape - duplicated field myDrawer has been dropped. AIS_InteractiveObject - myDrawer->Color() is now used instead of myOwnColor, myDrawer->Transparency() instead of myTransparency and myDrawer->ZLayer() instead of myZLayer. PrsMgr_PresentationManager::Unhighlight() now unhighlight all modes. The method taking Mode as argument has been marked deprecated. New enumeration Prs3d_TypeOfHighlight has been introduced defining different highlight types. AIS_InteractiveObject::HighlightStyle() now takes enumeration argument and defines different styles for Global and Local selection. ComesFromDecomposition() property has been moved from StdSelect_BRepOwner to SelectMgr_EntityOwner.
This commit is contained in:
@@ -7,11 +7,9 @@ PrsMgr_PresentableObject.hxx
|
||||
PrsMgr_PresentableObjectPointer.hxx
|
||||
PrsMgr_Presentation.cxx
|
||||
PrsMgr_Presentation.hxx
|
||||
PrsMgr_Presentation.lxx
|
||||
PrsMgr_Presentation3d.hxx
|
||||
PrsMgr_PresentationManager.cxx
|
||||
PrsMgr_PresentationManager.hxx
|
||||
PrsMgr_PresentationManager.lxx
|
||||
PrsMgr_PresentationManager3d.hxx
|
||||
PrsMgr_PresentationPointer.hxx
|
||||
PrsMgr_Presentations.hxx
|
||||
|
@@ -16,6 +16,7 @@
|
||||
|
||||
#include <PrsMgr_PresentableObject.hxx>
|
||||
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_Presentation.hxx>
|
||||
#include <Prs3d_Projector.hxx>
|
||||
#include <PrsMgr_ModedPresentation.hxx>
|
||||
@@ -23,7 +24,7 @@
|
||||
#include <TColStd_ListIteratorOfListOfInteger.hxx>
|
||||
#include <TColStd_MapOfInteger.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(PrsMgr_PresentableObject,MMgt_TShared)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(PrsMgr_PresentableObject, Standard_Transient)
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -44,13 +45,13 @@ const gp_Trsf& PrsMgr_PresentableObject::getIdentityTrsf()
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
PrsMgr_PresentableObject::PrsMgr_PresentableObject (const PrsMgr_TypeOfPresentation3d theType)
|
||||
: myTypeOfPresentation3d (theType),
|
||||
: myDrawer (new Prs3d_Drawer()),
|
||||
myTypeOfPresentation3d (theType),
|
||||
myIsMutable (Standard_False),
|
||||
myZLayer (Graphic3d_ZLayerId_Default),
|
||||
myHasOwnPresentations (Standard_True),
|
||||
myParent (NULL)
|
||||
{
|
||||
//
|
||||
myDrawer->SetDisplayMode (-1);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -407,12 +408,12 @@ void PrsMgr_PresentableObject::RemoveChild (const Handle(PrsMgr_PresentableObjec
|
||||
//=======================================================================
|
||||
void PrsMgr_PresentableObject::SetZLayer (const Graphic3d_ZLayerId theLayerId)
|
||||
{
|
||||
if (myZLayer == theLayerId)
|
||||
if (myDrawer->ZLayer() == theLayerId)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
myZLayer = theLayerId;
|
||||
myDrawer->SetZLayer (theLayerId);
|
||||
for (Standard_Integer aPrsIter = 1; aPrsIter <= myPresentations.Length(); ++aPrsIter)
|
||||
{
|
||||
const PrsMgr_ModedPresentation& aModedPrs = myPresentations (aPrsIter);
|
||||
@@ -432,7 +433,7 @@ void PrsMgr_PresentableObject::SetZLayer (const Graphic3d_ZLayerId theLayerId)
|
||||
//=======================================================================
|
||||
Graphic3d_ZLayerId PrsMgr_PresentableObject::ZLayer() const
|
||||
{
|
||||
return myZLayer;
|
||||
return myDrawer->ZLayer();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
@@ -532,3 +533,26 @@ void PrsMgr_PresentableObject::SetMutable (const Standard_Boolean theIsMutable)
|
||||
aModedPrs.Presentation()->Presentation()->SetMutable (theIsMutable);
|
||||
}
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetAttributes
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void PrsMgr_PresentableObject::SetAttributes (const Handle(Prs3d_Drawer)& theDrawer)
|
||||
{
|
||||
myDrawer = theDrawer;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : UnsetAttributes
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void PrsMgr_PresentableObject::UnsetAttributes()
|
||||
{
|
||||
Handle(Prs3d_Drawer) aDrawer = new Prs3d_Drawer();
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
aDrawer->Link(myDrawer->Link());
|
||||
}
|
||||
myDrawer = aDrawer;
|
||||
}
|
||||
|
@@ -46,9 +46,11 @@
|
||||
//! the relevant daughter classes and their member
|
||||
//! functions in AIS. This is particularly true in the
|
||||
//! creation of new interactive objects.
|
||||
class PrsMgr_PresentableObject : public MMgt_TShared
|
||||
class PrsMgr_PresentableObject : public Standard_Transient
|
||||
{
|
||||
DEFINE_STANDARD_RTTIEXT(PrsMgr_PresentableObject, MMgt_TShared)
|
||||
DEFINE_STANDARD_RTTIEXT(PrsMgr_PresentableObject, Standard_Transient)
|
||||
friend class PrsMgr_Presentation;
|
||||
friend class PrsMgr_PresentationManager;
|
||||
public:
|
||||
|
||||
PrsMgr_Presentations& Presentations() { return myPresentations; }
|
||||
@@ -208,17 +210,32 @@ public:
|
||||
//! Returns parent of current object in scene hierarchy.
|
||||
PrsMgr_PresentableObjectPointer Parent() const { return myParent; }
|
||||
|
||||
//! Initializes the drawing tool theDrawer.
|
||||
Standard_EXPORT virtual void SetAttributes(const Handle(Prs3d_Drawer)& theDrawer);
|
||||
|
||||
friend class PrsMgr_Presentation;
|
||||
friend class PrsMgr_PresentationManager;
|
||||
friend
|
||||
Standard_EXPORT Handle(Graphic3d_Structure) PrsMgr_Presentation::Compute (const Handle(Graphic3d_DataStructureManager)& theProjector);
|
||||
friend
|
||||
Standard_EXPORT void PrsMgr_Presentation::Compute (const Handle(Graphic3d_DataStructureManager)& theProjector, const Handle(Graphic3d_Structure)& theGivenStruct);
|
||||
friend
|
||||
Standard_EXPORT Handle(Graphic3d_Structure) PrsMgr_Presentation::Compute (const Handle(Graphic3d_DataStructureManager)& theProjector, const Handle(Geom_Transformation)& theTrsf);
|
||||
friend
|
||||
Standard_EXPORT void PrsMgr_Presentation::Compute (const Handle(Graphic3d_DataStructureManager)& theProjector, const Handle(Geom_Transformation)& theTrsf, const Handle(Graphic3d_Structure)& theGivenStruct);
|
||||
//! Returns the attributes settings.
|
||||
const Handle(Prs3d_Drawer)& Attributes() const
|
||||
{
|
||||
return myDrawer;
|
||||
}
|
||||
|
||||
//! Clears settings provided by the drawing tool theDrawer.
|
||||
Standard_EXPORT virtual void UnsetAttributes();
|
||||
|
||||
//! Returns the hilight attributes settings.
|
||||
const Handle(Prs3d_Drawer)& HilightAttributes() const { return myHilightDrawer; }
|
||||
|
||||
//! Initializes the hilight drawing tool theDrawer.
|
||||
virtual void SetHilightAttributes(const Handle(Prs3d_Drawer)& theDrawer) { myHilightDrawer = theDrawer; }
|
||||
|
||||
//! Returns the hilight attributes settings.
|
||||
const Handle(Prs3d_Drawer)& DynamicHilightAttributes() const { return myDynHilightDrawer; }
|
||||
|
||||
//! Initializes the dynamic hilight drawing tool.
|
||||
virtual void SetDynamicHilightAttributes (const Handle(Prs3d_Drawer)& theDrawer) { myDynHilightDrawer = theDrawer; }
|
||||
|
||||
//! Clears settings provided by the hilight drawing tool theDrawer.
|
||||
virtual void UnsetHilightAttributes() { myHilightDrawer.Nullify(); }
|
||||
|
||||
protected:
|
||||
|
||||
@@ -290,10 +307,12 @@ private:
|
||||
protected:
|
||||
|
||||
PrsMgr_Presentations myPresentations;
|
||||
PrsMgr_TypeOfPresentation3d myTypeOfPresentation3d;
|
||||
Handle(Graphic3d_SequenceOfHClipPlane) myClipPlanes;
|
||||
Handle(Prs3d_Drawer) myDrawer;
|
||||
Handle(Prs3d_Drawer) myHilightDrawer;
|
||||
Handle(Prs3d_Drawer) myDynHilightDrawer;
|
||||
PrsMgr_TypeOfPresentation3d myTypeOfPresentation3d;
|
||||
Standard_Boolean myIsMutable;
|
||||
Graphic3d_ZLayerId myZLayer;
|
||||
Standard_Boolean myHasOwnPresentations;
|
||||
|
||||
private:
|
||||
@@ -308,6 +327,6 @@ private:
|
||||
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE(PrsMgr_PresentableObject, MMgt_TShared)
|
||||
DEFINE_STANDARD_HANDLE(PrsMgr_PresentableObject, Standard_Transient)
|
||||
|
||||
#endif // _PrsMgr_PresentableObject_HeaderFile
|
||||
|
@@ -15,10 +15,10 @@
|
||||
#include <PrsMgr_Presentation.hxx>
|
||||
|
||||
#include <Geom_Transformation.hxx>
|
||||
#include <Graphic3d_HighlightStyle.hxx>
|
||||
#include <Graphic3d_DataStructureManager.hxx>
|
||||
#include <Graphic3d_Structure.hxx>
|
||||
#include <Precision.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_Presentation.hxx>
|
||||
#include <Prs3d_Projector.hxx>
|
||||
#include <PrsMgr_ModedPresentation.hxx>
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Graphic3d_CView.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(PrsMgr_Presentation,MMgt_TShared)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(PrsMgr_Presentation, Standard_Transient)
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -126,7 +126,7 @@ void PrsMgr_Presentation::SetVisible (const Standard_Boolean theValue)
|
||||
//function : Highlight
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void PrsMgr_Presentation::Highlight (const Handle(Graphic3d_HighlightStyle)& theStyle)
|
||||
void PrsMgr_Presentation::Highlight (const Handle(Prs3d_Drawer)& theStyle)
|
||||
{
|
||||
if (!IsHighlighted())
|
||||
{
|
||||
|
@@ -17,64 +17,50 @@
|
||||
#ifndef _PrsMgr_Presentation_HeaderFile
|
||||
#define _PrsMgr_Presentation_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <PrsMgr_PresentableObjectPointer.hxx>
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Aspect_TypeOfHighlightMethod.hxx>
|
||||
#include <Quantity_Length.hxx>
|
||||
|
||||
class PrsMgr_PresentationManager;
|
||||
class PrsMgr_Prs;
|
||||
class PrsMgr_PresentableObject;
|
||||
class Quantity_Color;
|
||||
class Geom_Transformation;
|
||||
class Prs3d_Presentation;
|
||||
class Graphic3d_HighlightStyle;
|
||||
class Prs3d_Drawer;
|
||||
class Graphic3d_Structure;
|
||||
class Graphic3d_DataStructureManager;
|
||||
class Prs3d_Projector;
|
||||
|
||||
DEFINE_STANDARD_HANDLE(PrsMgr_Presentation, Standard_Transient)
|
||||
|
||||
class PrsMgr_Presentation;
|
||||
DEFINE_STANDARD_HANDLE(PrsMgr_Presentation, MMgt_TShared)
|
||||
|
||||
|
||||
class PrsMgr_Presentation : public MMgt_TShared
|
||||
class PrsMgr_Presentation : public Standard_Transient
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(PrsMgr_Presentation, Standard_Transient)
|
||||
friend class PrsMgr_PresentationManager;
|
||||
friend class PrsMgr_PresentableObject;
|
||||
friend class PrsMgr_Prs;
|
||||
public:
|
||||
|
||||
|
||||
//! Destructor
|
||||
Standard_EXPORT ~PrsMgr_Presentation();
|
||||
|
||||
const Handle(Prs3d_Presentation)& Presentation() const;
|
||||
|
||||
|
||||
const Handle(Prs3d_Presentation)& Presentation() const { return myStructure; }
|
||||
|
||||
//! returns the PresentationManager in which the presentation has been created.
|
||||
const Handle(PrsMgr_PresentationManager)& PresentationManager() const;
|
||||
|
||||
void SetUpdateStatus (const Standard_Boolean theStat);
|
||||
|
||||
Standard_Boolean MustBeUpdated() const;
|
||||
|
||||
friend class PrsMgr_PresentationManager;
|
||||
friend class PrsMgr_PresentableObject;
|
||||
friend class PrsMgr_Prs;
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(PrsMgr_Presentation,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
const Handle(PrsMgr_PresentationManager)& PresentationManager() const { return myPresentationManager; }
|
||||
|
||||
void SetUpdateStatus (const Standard_Boolean theUpdateStatus) { myMustBeUpdated = theUpdateStatus; }
|
||||
|
||||
Standard_Boolean MustBeUpdated() const { return myMustBeUpdated; }
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT PrsMgr_Presentation(const Handle(PrsMgr_PresentationManager)& thePresentationManager, const Handle(PrsMgr_PresentableObject)& thePresentableObject);
|
||||
|
||||
Standard_EXPORT void Display();
|
||||
@@ -86,7 +72,7 @@ private:
|
||||
|
||||
Standard_EXPORT void SetVisible (const Standard_Boolean theValue);
|
||||
|
||||
Standard_EXPORT void Highlight (const Handle(Graphic3d_HighlightStyle)& theStyle);
|
||||
Standard_EXPORT void Highlight (const Handle(Prs3d_Drawer)& theStyle);
|
||||
|
||||
Standard_EXPORT void Unhighlight() const;
|
||||
|
||||
@@ -132,14 +118,6 @@ protected:
|
||||
Standard_Boolean myMustBeUpdated;
|
||||
Standard_Integer myBeforeHighlightState;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <PrsMgr_Presentation.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _PrsMgr_Presentation_HeaderFile
|
||||
|
@@ -1,37 +0,0 @@
|
||||
// Created on: 1997-02-20
|
||||
// Created by: Robert COUBLANC
|
||||
// Copyright (c) 1997-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <PrsMgr_Prs.hxx>
|
||||
|
||||
inline void PrsMgr_Presentation::SetUpdateStatus (const Standard_Boolean theUpdateStatus)
|
||||
{
|
||||
myMustBeUpdated = theUpdateStatus;
|
||||
}
|
||||
|
||||
inline Standard_Boolean PrsMgr_Presentation::MustBeUpdated() const
|
||||
{
|
||||
return myMustBeUpdated;
|
||||
}
|
||||
|
||||
inline const Handle(PrsMgr_PresentationManager)& PrsMgr_Presentation::PresentationManager() const
|
||||
{
|
||||
return myPresentationManager;
|
||||
}
|
||||
|
||||
inline const Handle(Prs3d_Presentation)& PrsMgr_Presentation::Presentation() const
|
||||
{
|
||||
return myStructure;
|
||||
}
|
@@ -12,22 +12,23 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <PrsMgr_PresentationManager.hxx>
|
||||
|
||||
#include <Geom_Transformation.hxx>
|
||||
#include <Graphic3d_GraphicDriver.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_Presentation.hxx>
|
||||
#include <Prs3d_PresentationShadow.hxx>
|
||||
#include <PrsMgr_ModedPresentation.hxx>
|
||||
#include <PrsMgr_PresentableObject.hxx>
|
||||
#include <PrsMgr_Presentation.hxx>
|
||||
#include <PrsMgr_PresentationManager.hxx>
|
||||
#include <PrsMgr_Presentations.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TColStd_ListIteratorOfListOfTransient.hxx>
|
||||
#include <V3d_View.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(PrsMgr_PresentationManager,MMgt_TShared)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(PrsMgr_PresentationManager, Standard_Transient)
|
||||
|
||||
// =======================================================================
|
||||
// function : PrsMgr_PresentationManager
|
||||
@@ -164,18 +165,24 @@ void PrsMgr_PresentationManager::SetVisibility (const Handle(PrsMgr_PresentableO
|
||||
// function : Unhighlight
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void PrsMgr_PresentationManager::Unhighlight (const Handle(PrsMgr_PresentableObject)& thePrsObj,
|
||||
const Standard_Integer theMode)
|
||||
void PrsMgr_PresentationManager::Unhighlight (const Handle(PrsMgr_PresentableObject)& thePrsObj)
|
||||
{
|
||||
for (PrsMgr_ListOfPresentableObjectsIter anIter (thePrsObj->Children()); anIter.More(); anIter.Next())
|
||||
{
|
||||
Unhighlight (anIter.Value(), theMode);
|
||||
Unhighlight (anIter.Value());
|
||||
}
|
||||
|
||||
const Handle(PrsMgr_Presentation) aPrs = Presentation (thePrsObj, theMode);
|
||||
if (!aPrs.IsNull())
|
||||
const PrsMgr_Presentations& aPrsList = thePrsObj->Presentations();
|
||||
for (Standard_Integer aPrsIter = 1; aPrsIter <= aPrsList.Length(); ++aPrsIter)
|
||||
{
|
||||
aPrs->Unhighlight();
|
||||
const PrsMgr_ModedPresentation& aModedPrs = aPrsList.Value (aPrsIter);
|
||||
const Handle(PrsMgr_Presentation)& aPrs = aModedPrs.Presentation();
|
||||
const Handle(PrsMgr_PresentationManager)& aPrsMgr = aPrs->PresentationManager();
|
||||
if (this == aPrsMgr
|
||||
&& aPrs->IsHighlighted())
|
||||
{
|
||||
aPrs->Unhighlight();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -565,13 +572,12 @@ void PrsMgr_PresentationManager::Transform (const Handle(PrsMgr_PresentableObjec
|
||||
Presentation (thePrsObj, theMode)->SetTransformation (theTransformation);
|
||||
}
|
||||
|
||||
|
||||
// =======================================================================
|
||||
// function : Color
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void PrsMgr_PresentationManager::Color (const Handle(PrsMgr_PresentableObject)& thePrsObj,
|
||||
const Handle(Graphic3d_HighlightStyle)& theStyle,
|
||||
const Handle(Prs3d_Drawer)& theStyle,
|
||||
const Standard_Integer theMode,
|
||||
const Handle(PrsMgr_PresentableObject)& theSelObj,
|
||||
const Standard_Integer theImmediateStructLayerId)
|
||||
|
@@ -20,7 +20,7 @@
|
||||
#include <Graphic3d_NameOfMaterial.hxx>
|
||||
#include <Graphic3d_StructureManager.hxx>
|
||||
#include <Graphic3d_ZLayerId.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <PrsMgr_ListOfPresentations.hxx>
|
||||
#include <Quantity_Color.hxx>
|
||||
#include <Quantity_NameOfColor.hxx>
|
||||
@@ -30,26 +30,24 @@
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
class Geom_Transformation;
|
||||
class Prs3d_Drawer;
|
||||
class Prs3d_Presentation;
|
||||
class PrsMgr_PresentableObject;
|
||||
class PrsMgr_Presentation;
|
||||
class Standard_NoSuchObject;
|
||||
class V3d_Viewer;
|
||||
|
||||
class PrsMgr_PresentationManager;
|
||||
DEFINE_STANDARD_HANDLE(PrsMgr_PresentationManager, MMgt_TShared)
|
||||
DEFINE_STANDARD_HANDLE(PrsMgr_PresentationManager, Standard_Transient)
|
||||
|
||||
//! A framework to manage 3D displays, graphic entities and their updates.
|
||||
//! Used in the AIS package (Application Interactive Services), to enable the advanced user to define the
|
||||
//! default display mode of a new interactive object which extends the list of signatures and types.
|
||||
//! Definition of new display types is handled by calling the presentation algorithms provided by the StdPrs package.
|
||||
class PrsMgr_PresentationManager : public MMgt_TShared
|
||||
class PrsMgr_PresentationManager : public Standard_Transient
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(PrsMgr_PresentationManager, Standard_Transient)
|
||||
public:
|
||||
|
||||
|
||||
|
||||
//! Creates a framework to manage displays and graphic entities with the 3D view theStructureManager.
|
||||
Standard_EXPORT PrsMgr_PresentationManager(const Handle(Graphic3d_StructureManager)& theStructureManager);
|
||||
|
||||
@@ -69,10 +67,11 @@ public:
|
||||
//! Sets the visibility of presentable object.
|
||||
Standard_EXPORT void SetVisibility (const Handle(PrsMgr_PresentableObject)& thePrsObject, const Standard_Integer theMode, const Standard_Boolean theValue);
|
||||
|
||||
//! Removes highlighting from the presentation of the
|
||||
//! presentable object thePrsObject in this framework with the display mode theMode.
|
||||
Standard_EXPORT void Unhighlight (const Handle(PrsMgr_PresentableObject)& thePrsObject, const Standard_Integer theMode = 0);
|
||||
|
||||
//! Removes highlighting from the presentation of the presentable object.
|
||||
Standard_EXPORT void Unhighlight (const Handle(PrsMgr_PresentableObject)& thePrsObject);
|
||||
|
||||
Standard_DEPRECATED("Deprecated method Unhighlight() - argument theMode will be ignored")
|
||||
void Unhighlight (const Handle(PrsMgr_PresentableObject)& thePrsObject, const Standard_Integer theMode) { Unhighlight (thePrsObject); (void )theMode; }
|
||||
|
||||
//! Sets the display priority theNewPrior of the
|
||||
//! presentable object thePrsObject in this framework with the display mode theMode.
|
||||
@@ -119,13 +118,13 @@ public:
|
||||
Standard_EXPORT void RedrawImmediate (const Handle(V3d_Viewer)& theViewer);
|
||||
|
||||
//! Returns true if Presentation Manager is accumulating transient list of presentations to be displayed in immediate mode.
|
||||
Standard_Boolean IsImmediateModeOn() const;
|
||||
Standard_Boolean IsImmediateModeOn() const { return myImmediateModeOn > 0; }
|
||||
|
||||
//! Highlights the graphic object thePrsObject in the color theColor.
|
||||
//! thePrsObject has the display mode theMode;
|
||||
//! this has the default value of 0, that is, the wireframe display mode.
|
||||
Standard_EXPORT void Color (const Handle(PrsMgr_PresentableObject)& thePrsObject,
|
||||
const Handle(Graphic3d_HighlightStyle)& theStyle,
|
||||
const Handle(Prs3d_Drawer)& theStyle,
|
||||
const Standard_Integer theMode = 0,
|
||||
const Handle(PrsMgr_PresentableObject)& theSelObj = NULL,
|
||||
const Graphic3d_ZLayerId theImmediateStructLayerId = Graphic3d_ZLayerId_Topmost);
|
||||
@@ -138,7 +137,7 @@ public:
|
||||
Standard_EXPORT void Transform (const Handle(PrsMgr_PresentableObject)& thePrsObject, const Handle(Geom_Transformation)& theTransformation, const Standard_Integer theMode = 0);
|
||||
|
||||
//! Returns the structure manager.
|
||||
const Handle(Graphic3d_StructureManager)& StructureManager() const;
|
||||
const Handle(Graphic3d_StructureManager)& StructureManager() const { return myStructureManager; }
|
||||
|
||||
//! Returns true if there is a presentation of the
|
||||
//! presentable object thePrsObject in this framework, thePrsObject having the display mode theMode.
|
||||
@@ -158,34 +157,24 @@ public:
|
||||
const Standard_Integer theMode = 0,
|
||||
const Handle(PrsMgr_PresentableObject)& theSelObj = NULL);
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(PrsMgr_PresentationManager,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
//! Removes a presentation of the presentable object thePrsObject to this framework. thePrsObject has the display mode theMode.
|
||||
Standard_EXPORT Standard_Boolean RemovePresentation (const Handle(PrsMgr_PresentableObject)& thePrsObject, const Standard_Integer theMode = 0);
|
||||
|
||||
Handle(Graphic3d_StructureManager) myStructureManager;
|
||||
Standard_Integer myImmediateModeOn;
|
||||
PrsMgr_ListOfPresentations myImmediateList;
|
||||
PrsMgr_ListOfPresentations myViewDependentImmediateList;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
//! Handles the structures from <myImmediateList> and displays it separating view-dependent structures and taking into account
|
||||
//! structure visibility by setting proper affinity.
|
||||
void displayImmediate (const Handle(V3d_Viewer)& theViewer);
|
||||
|
||||
protected:
|
||||
|
||||
Handle(Graphic3d_StructureManager) myStructureManager;
|
||||
Standard_Integer myImmediateModeOn;
|
||||
PrsMgr_ListOfPresentations myImmediateList;
|
||||
PrsMgr_ListOfPresentations myViewDependentImmediateList;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <PrsMgr_PresentationManager.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _PrsMgr_PresentationManager_HeaderFile
|
||||
|
@@ -1,25 +0,0 @@
|
||||
// Created on: 1998-04-23
|
||||
// Created by: Robert COUBLANC
|
||||
// Copyright (c) 1998-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
inline Standard_Boolean PrsMgr_PresentationManager::IsImmediateModeOn() const
|
||||
{
|
||||
return myImmediateModeOn > 0;
|
||||
}
|
||||
|
||||
inline const Handle(Graphic3d_StructureManager)& PrsMgr_PresentationManager::StructureManager() const
|
||||
{
|
||||
return myStructureManager;
|
||||
}
|
Reference in New Issue
Block a user