mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-03 14:10:33 +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:
@@ -54,6 +54,7 @@ Prs3d_ToolQuadric.hxx
|
||||
Prs3d_ToolQuadric.cxx
|
||||
Prs3d_ToolSphere.hxx
|
||||
Prs3d_ToolSphere.cxx
|
||||
Prs3d_TypeOfHighlight.hxx
|
||||
Prs3d_TypeOfHLR.hxx
|
||||
Prs3d_TypeOfLinePicking.hxx
|
||||
Prs3d_VertexDrawMode.hxx
|
||||
|
@@ -27,7 +27,7 @@
|
||||
#include <Prs3d_ShadingAspect.hxx>
|
||||
#include <Prs3d_TextAspect.hxx>
|
||||
|
||||
IMPLEMENT_STANDARD_RTTIEXT(Prs3d_Drawer,MMgt_TShared)
|
||||
IMPLEMENT_STANDARD_RTTIEXT(Prs3d_Drawer, Graphic3d_PresentationAttributes)
|
||||
|
||||
// =======================================================================
|
||||
// function : Prs3d_Drawer
|
||||
@@ -94,10 +94,7 @@ Prs3d_Drawer::Prs3d_Drawer()
|
||||
myHasOwnDimLengthModelUnits (Standard_False),
|
||||
myHasOwnDimAngleModelUnits (Standard_False),
|
||||
myHasOwnDimLengthDisplayUnits (Standard_False),
|
||||
myHasOwnDimAngleDisplayUnits (Standard_False),
|
||||
|
||||
myHasOwnHighlightStyle (Standard_False),
|
||||
myHasOwnSelectionStyle (Standard_False)
|
||||
myHasOwnDimAngleDisplayUnits (Standard_False)
|
||||
{
|
||||
myDimensionModelUnits.SetLengthUnits ("m");
|
||||
myDimensionModelUnits.SetAngleUnits ("rad");
|
||||
@@ -1016,8 +1013,6 @@ void Prs3d_Drawer::ClearLocalAttributes()
|
||||
myDatumAspect.Nullify();
|
||||
myDimensionAspect.Nullify();
|
||||
mySectionAspect.Nullify();
|
||||
myHighlightStyle.Nullify();
|
||||
mySelectionStyle.Nullify();
|
||||
|
||||
myHasOwnUIsoAspect = Standard_False;
|
||||
myHasOwnVIsoAspect = Standard_False;
|
||||
@@ -1059,8 +1054,6 @@ void Prs3d_Drawer::ClearLocalAttributes()
|
||||
myHasOwnDimLengthDisplayUnits = Standard_False;
|
||||
myHasOwnDimAngleModelUnits = Standard_False;
|
||||
myHasOwnDimAngleDisplayUnits = Standard_False;
|
||||
myHasOwnHighlightStyle = Standard_False;
|
||||
myHasOwnSelectionStyle = Standard_False;
|
||||
|
||||
myVertexDrawMode = Prs3d_VDM_Inherited;
|
||||
myTypeOfHLR = Prs3d_TOH_NotSet;
|
||||
@@ -1247,23 +1240,3 @@ void Prs3d_Drawer::SetShaderProgram (const Handle(Graphic3d_ShaderProgram)& theP
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetHighlightStyle
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Prs3d_Drawer::SetHighlightStyle (const Handle(Graphic3d_HighlightStyle)& theStyle)
|
||||
{
|
||||
myHighlightStyle = theStyle;
|
||||
myHasOwnHighlightStyle = !myHighlightStyle.IsNull();
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetSelectionStyle
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void Prs3d_Drawer::SetSelectionStyle (const Handle(Graphic3d_HighlightStyle)& theStyle)
|
||||
{
|
||||
mySelectionStyle = theStyle;
|
||||
myHasOwnSelectionStyle = !mySelectionStyle.IsNull();
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@
|
||||
#include <Quantity_Length.hxx>
|
||||
#include <Aspect_TypeOfDeflection.hxx>
|
||||
#include <Graphic3d_GroupAspect.hxx>
|
||||
#include <Graphic3d_HighlightStyle.hxx>
|
||||
#include <Graphic3d_PresentationAttributes.hxx>
|
||||
#include <Graphic3d_ShaderProgram.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Prs3d_VertexDrawMode.hxx>
|
||||
@@ -42,15 +42,14 @@ class Prs3d_DatumAspect;
|
||||
class Prs3d_DimensionAspect;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
class Prs3d_Drawer;
|
||||
DEFINE_STANDARD_HANDLE(Prs3d_Drawer, MMgt_TShared)
|
||||
DEFINE_STANDARD_HANDLE(Prs3d_Drawer, Graphic3d_PresentationAttributes)
|
||||
|
||||
//! A graphic attribute manager which governs how
|
||||
//! objects such as color, width, line thickness and deflection are displayed.
|
||||
//! A drawer includes an instance of the Aspect classes with particular default values.
|
||||
class Prs3d_Drawer : public MMgt_TShared
|
||||
class Prs3d_Drawer : public Graphic3d_PresentationAttributes
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(Prs3d_Drawer, Graphic3d_PresentationAttributes)
|
||||
public:
|
||||
|
||||
//! Default constructor.
|
||||
@@ -824,36 +823,6 @@ public:
|
||||
//! that overrides the one in the link.
|
||||
Standard_Boolean HasOwnDimAngleDisplayUnits() const { return myHasOwnDimAngleDisplayUnits; }
|
||||
|
||||
//! Returns true if the drawer has its own style of dynamic highlighting
|
||||
//! that overrides the one in the link
|
||||
Standard_Boolean HasOwnHighlightStyle() const { return myHasOwnHighlightStyle; }
|
||||
|
||||
//! Returns own dynamic highlight style or corresponding style of the link. If no one of
|
||||
//! them is defined, invalid handle will be returned.
|
||||
const Handle(Graphic3d_HighlightStyle)& HighlightStyle() const
|
||||
{
|
||||
return HasOwnHighlightStyle() || myLink.IsNull()
|
||||
? myHighlightStyle : myLink->HighlightStyle();
|
||||
}
|
||||
|
||||
//! Allows to set own dynamic highlight style.
|
||||
Standard_EXPORT void SetHighlightStyle (const Handle(Graphic3d_HighlightStyle)& theStyle);
|
||||
|
||||
//! Returns true if the drawer has its own style of selection highlighting
|
||||
//! that overrides the one in the link
|
||||
Standard_Boolean HasOwnSelectionStyle() const { return myHasOwnSelectionStyle; }
|
||||
|
||||
//! Returns own selection highlight style or corresponding style of the link. If no one of
|
||||
//! them is defined, invalid handle will be returned.
|
||||
const Handle(Graphic3d_HighlightStyle)& SelectionStyle() const
|
||||
{
|
||||
return HasOwnSelectionStyle() || myLink.IsNull()
|
||||
? mySelectionStyle : myLink->SelectionStyle();
|
||||
}
|
||||
|
||||
//! Allows to set own selection highlight style.
|
||||
Standard_EXPORT void SetSelectionStyle (const Handle(Graphic3d_HighlightStyle)& theStyle);
|
||||
|
||||
//! Returns the drawer to which the current object references.
|
||||
const Handle(Prs3d_Drawer)& Link() { return myLink; }
|
||||
|
||||
@@ -861,10 +830,10 @@ public:
|
||||
Standard_Boolean HasLink() const { return !myLink.IsNull(); }
|
||||
|
||||
//! Sets theDrawer as a link to which the current object references.
|
||||
void Link (const Handle(Prs3d_Drawer)& theDrawer)
|
||||
{
|
||||
myLink = theDrawer;
|
||||
}
|
||||
void Link (const Handle(Prs3d_Drawer)& theDrawer) { SetLink (theDrawer); }
|
||||
|
||||
//! Sets theDrawer as a link to which the current object references.
|
||||
void SetLink (const Handle(Prs3d_Drawer)& theDrawer) { myLink = theDrawer; }
|
||||
|
||||
//! Removes local attributes.
|
||||
Standard_EXPORT void ClearLocalAttributes();
|
||||
@@ -968,15 +937,9 @@ protected:
|
||||
Standard_Boolean myHasOwnDimLengthDisplayUnits;
|
||||
Standard_Boolean myHasOwnDimAngleDisplayUnits;
|
||||
|
||||
Handle(Graphic3d_HighlightStyle) myHighlightStyle;
|
||||
Standard_Boolean myHasOwnHighlightStyle;
|
||||
Handle(Graphic3d_HighlightStyle) mySelectionStyle;
|
||||
Standard_Boolean myHasOwnSelectionStyle;
|
||||
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(Prs3d_Drawer,MMgt_TShared)
|
||||
|
||||
};
|
||||
|
||||
Standard_DEPRECATED("Class name is deprecated - use Prs3d_Drawer instead")
|
||||
typedef Prs3d_Drawer Graphic3d_HighlightStyle;
|
||||
|
||||
#endif // _Prs3d_Drawer_HeaderFile
|
||||
|
29
src/Prs3d/Prs3d_TypeOfHighlight.hxx
Normal file
29
src/Prs3d/Prs3d_TypeOfHighlight.hxx
Normal file
@@ -0,0 +1,29 @@
|
||||
// Copyright (c) 2016 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.
|
||||
|
||||
#ifndef _Prs3d_TypeOfHighlight_HeaderFile
|
||||
#define _Prs3d_TypeOfHighlight_HeaderFile
|
||||
|
||||
//! Type of highlighting to apply specific style.
|
||||
enum Prs3d_TypeOfHighlight
|
||||
{
|
||||
Prs3d_TypeOfHighlight_None = 0, //!< no highlighting
|
||||
Prs3d_TypeOfHighlight_Selected, //!< entire object is selected
|
||||
Prs3d_TypeOfHighlight_Dynamic, //!< entire object is dynamically highlighted
|
||||
Prs3d_TypeOfHighlight_LocalSelected, //!< part of the object is selected
|
||||
Prs3d_TypeOfHighlight_LocalDynamic, //!< part of the object is dynamically highlighted
|
||||
Prs3d_TypeOfHighlight_SubIntensity, //!< sub-intensity style
|
||||
Prs3d_TypeOfHighlight_NB
|
||||
};
|
||||
|
||||
#endif // _Prs3d_TypeOfHighlight_HeaderFile
|
Reference in New Issue
Block a user