Auxiliary AIS_GlobalStatus constructor has been removed.
AIS_InteractiveContext::setObjectStatus() no more adds
an invalid -1 mode to AIS_GlobalStatus.
Never updated property AIS_GlobalStatus::GetLayerIndex() has been removed;
AIS_InteractiveContext::SetTransformPersistence() has been corrected to use
ZLayer defined within object itself.
#include <AIS_GlobalStatus.hxx>
-#include <AIS_DisplayMode.hxx>
-#include <Standard_Type.hxx>
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
-
IMPLEMENT_STANDARD_RTTIEXT(AIS_GlobalStatus, Standard_Transient)
-AIS_GlobalStatus::AIS_GlobalStatus():
-myDispMode(AIS_WireFrame),
-myLayerIndex(0),
-myIsHilit(Standard_False),
-mySubInt(Standard_False)
+// =======================================================================
+// function : AIS_GlobalStatus
+// purpose :
+// =======================================================================
+AIS_GlobalStatus::AIS_GlobalStatus()
+: myDispMode (0),
+ myIsHilit(Standard_False),
+ mySubInt (Standard_False)
{
}
-
-AIS_GlobalStatus::AIS_GlobalStatus (const Standard_Integer theDMode,
- const Standard_Integer theSMode,
- const Standard_Integer theLayer):
-myDispMode (theDMode),
-myLayerIndex (theLayer),
-myIsHilit (Standard_False),
-mySubInt (Standard_False)
-{
- mySelModes.Append (theSMode);
-}
-
-void AIS_GlobalStatus::RemoveSelectionMode(const Standard_Integer aMode)
-{
- TColStd_ListIteratorOfListOfInteger anIt (mySelModes);
- for (; anIt.More(); anIt.Next())
- {
- if (anIt.Value() == aMode)
- {
- mySelModes.Remove (anIt);
- return;
- }
- }
-}
-
-void AIS_GlobalStatus::ClearSelectionModes()
-{
- mySelModes.Clear();
-}
-
-Standard_Boolean AIS_GlobalStatus::IsSModeIn(const Standard_Integer aMode) const
-{
- TColStd_ListIteratorOfListOfInteger anIt (mySelModes);
- for (; anIt.More(); anIt.Next())
- {
- if (anIt.Value() == aMode)
- {
- return Standard_True;
- }
- }
- return Standard_False;
-}
DEFINE_STANDARD_HANDLE(AIS_GlobalStatus, Standard_Transient)
-//! Stores information about objects in graphic context:
-//! - Status Of Display : in the main viewer
-//! hidden in the main viewer
-//! - Displayed Modes
-//! - Active Selection Modes
-//! - is the Interactive Object Current ?
-//! - Layer Index
+//! Stores information about objects in graphic context:
class AIS_GlobalStatus : public Standard_Transient
{
DEFINE_STANDARD_RTTIEXT(AIS_GlobalStatus, Standard_Transient)
public:
+ //! Default constructor.
Standard_EXPORT AIS_GlobalStatus();
-
- Standard_EXPORT AIS_GlobalStatus (const Standard_Integer theDispMode,
- const Standard_Integer theSelMode,
- const Standard_Integer theLayerIndex = 0);
- void AddSelectionMode (const Standard_Integer theMode) { if (!IsSModeIn (theMode)) mySelModes.Append (theMode); }
+ //! Returns the display mode.
+ Standard_Integer DisplayMode() const { return myDispMode; }
//! Sets display mode.
void SetDisplayMode (const Standard_Integer theMode) { myDispMode = theMode; }
- //! Returns the display mode.
- Standard_Integer DisplayMode() const { return myDispMode; }
-
- void SetLayerIndex (const Standard_Integer theIndex) { myLayerIndex = theIndex; }
+ //! Returns TRUE if object is highlighted
+ Standard_Boolean IsHilighted() const { return myIsHilit; }
+ //! Sets highlighted state.
void SetHilightStatus (const Standard_Boolean theStatus) { myIsHilit = theStatus; }
//! Changes applied highlight style for a particular object
//! Returns applied highlight style for a particular object
const Handle(Prs3d_Drawer)& HilightStyle() const { return myHiStyle; }
- Standard_Boolean IsSubIntensityOn() const { return mySubInt; }
-
- void SubIntensityOn() { mySubInt = Standard_True; }
+ //! Returns active selection modes of the object.
+ const TColStd_ListOfInteger& SelectionModes() const { return mySelModes; }
- void SubIntensityOff() { mySubInt = Standard_False; }
-
- Standard_EXPORT void RemoveSelectionMode (const Standard_Integer aMode);
-
- Standard_EXPORT void ClearSelectionModes();
+ //! Return TRUE if selection mode was registered.
+ Standard_Boolean IsSModeIn (Standard_Integer theMode) const
+ {
+ return mySelModes.Contains (theMode);
+ }
- //! keeps the active selection modes of the object
- //! in the main viewer.
- const TColStd_ListOfInteger& SelectionModes() const { return mySelModes; }
-
- Standard_Boolean IsHilighted() const { return myIsHilit; }
+ //! Add selection mode.
+ Standard_Boolean AddSelectionMode (const Standard_Integer theMode)
+ {
+ if (!mySelModes.Contains (theMode))
+ {
+ mySelModes.Append (theMode);
+ return Standard_True;
+ }
+ return Standard_False;
+ }
- Standard_EXPORT Standard_Boolean IsSModeIn (const Standard_Integer aMode) const;
+ //! Remove selection mode.
+ Standard_Boolean RemoveSelectionMode (const Standard_Integer theMode)
+ {
+ return mySelModes.Remove (theMode);
+ }
- //! Returns layer index.
- Standard_Integer GetLayerIndex() const
+ //! Remove all selection modes.
+ void ClearSelectionModes()
{
- return myLayerIndex;
+ mySelModes.Clear();
}
+ Standard_Boolean IsSubIntensityOn() const { return mySubInt; }
+
+ void SetSubIntensity (Standard_Boolean theIsOn) { mySubInt = theIsOn; }
+
private:
TColStd_ListOfInteger mySelModes;
Handle(Prs3d_Drawer) myHiStyle;
Standard_Integer myDispMode;
- Standard_Integer myLayerIndex;
Standard_Boolean myIsHilit;
Standard_Boolean mySubInt;
}
if (!mgrSelector->IsActivated (theIObj, theSelectionMode))
{
- if (!aStatus->IsSModeIn (theSelectionMode))
- aStatus->AddSelectionMode (theSelectionMode);
+ aStatus->AddSelectionMode (theSelectionMode);
mgrSelector->Activate (theIObj, theSelectionMode);
}
}
mgrSelector->UpdateSelection (theObject);
- const Standard_Integer aLayerId = myObjects.Find (theObject)->GetLayerIndex();
+ const Graphic3d_ZLayerId aLayerId = theObject->ZLayer();
const Handle(V3d_Viewer)& aCurViewer = CurrentViewer();
for (V3d_ListOfViewIterator anActiveViewIter (aCurViewer->ActiveViewIterator()); anActiveViewIter.More(); anActiveViewIter.Next())
{
theIObj->SetDisplayStatus (theStatus);
if (theStatus != PrsMgr_DisplayStatus_None)
{
- Handle(AIS_GlobalStatus) aStatus = new AIS_GlobalStatus (theDispMode, theSelectionMode);
+ Handle(AIS_GlobalStatus) aStatus = new AIS_GlobalStatus();
+ aStatus->SetDisplayMode (theDispMode);
+ if (theSelectionMode != -1)
+ {
+ aStatus->AddSelectionMode (theSelectionMode);
+ }
myObjects.Bind (theIObj, aStatus);
}
else
continue;
}
- aStatus->SubIntensityOn();
+ aStatus->SetSubIntensity (true);
myMainPM->Color (anObjsIter.Key(), aSubStyle, theDispMode != -1 ? theDispMode : aStatus->DisplayMode());
}
}
return;
}
- aStatus->SubIntensityOn();
+ aStatus->SetSubIntensity (true);
myMainPM->Color (theObject, aSubStyle, theDispMode != -1 ? theDispMode : aStatus->DisplayMode());
}
}
return;
}
- (*aStatus)->SubIntensityOff();
+ (*aStatus)->SetSubIntensity (false);
Standard_Boolean toUpdateMain = Standard_False;
if (theObj->DisplayStatus() == PrsMgr_DisplayStatus_Displayed)
{
}
-static Standard_Integer OCC166 (Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** argv)
-{
-
- Handle(AIS_InteractiveContext) myAISContext = ViewerTest::GetAISContext();
- if(myAISContext.IsNull()) {
- di << "use 'vinit' command before " << argv[0];
- return 1;
- }
-
- BRepPrimAPI_MakeBox aBox(gp_Pnt(0, 0, 0), 100, 100, 100);
- Handle(AIS_Shape) anAISBox = new AIS_Shape(aBox.Shape());
- myAISContext->SetAutoActivateSelection (Standard_False);
- myAISContext->Display(anAISBox, 1);
-
- TColStd_ListOfInteger anActivatedModes;
- myAISContext->ActivatedModes (anAISBox, anActivatedModes);
- if(anActivatedModes.Extent() != 1 || anActivatedModes.First() != -1 )
- return 1;
-
- return 0;
-}
-
#include <TDocStd_Document.hxx>
#include <DDocStd.hxx>
#include <PCDM_StoreStatus.hxx>
theCommands.Add("OCC305","OCC305 file",__FILE__,OCC305,group);
// New commands:
- theCommands.Add("OCC166", "OCC166", __FILE__, OCC166, group);
theCommands.Add("OCC381_Save", "OCC381_Save Doc", __FILE__, OCC381_Save, group);
theCommands.Add("OCC381_SaveAs", "OCC381_SaveAs Doc Path", __FILE__, OCC381_SaveAs, group);
+++ /dev/null
-puts "================="
-puts "OCC166"
-puts "================="
-puts ""
-
-vinit
-
-if [ catch { OCC166 } res ] then {
- puts "OCC166: Error"
-} else {
- puts "OCC166: OK"
-}
-
-checkview -screenshot -3d -path ${imagedir}/${test_image}.png