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

0025552: Visualization - provide the way to hide the object in specified view of the viewer

Add test case bugs/vis/bug25552
OpenGl_GraphicDriver - do not use View and Workspace identifiers on level of entire Driver
This commit is contained in:
kgv
2015-03-05 13:50:47 +03:00
committed by bugmaster
parent 8621cdc2b7
commit a272ed9466
32 changed files with 572 additions and 80 deletions

View File

@@ -105,6 +105,7 @@ uses
AsciiString from TCollection,
ExtendedString from TCollection,
CGraduatedTrihedron from Graphic3d,
NMapOfTransient from Graphic3d,
TypeOfStructure from Graphic3d,
PixMap from Image,
@@ -1152,6 +1153,16 @@ is
-- In contrast to Bitmaps, Vector graphics is scalable (so you may got quality benefits on printing to laser printer).
-- Notice however that results may differ a lot and do not contain some elements.
HiddenObjects (me) returns NMapOfTransient from Graphic3d is static;
---C++: return const &
---Level: Public
---Purpose: Returns map of objects hidden within this specific view (not viewer-wise).
ChangeHiddenObjects (me : mutable) returns NMapOfTransient from Graphic3d is static;
---C++: return &
---Level: Public
---Purpose: Returns map of objects hidden within this specific view (not viewer-wise).
fields
-- the ViewManager associated with the view
@@ -1193,6 +1204,8 @@ fields
myStructuresUpdated : Boolean from Standard;
myHiddenObjects : NMapOfTransient from Graphic3d;
friends
class ViewManager from Visual3d

View File

@@ -53,6 +53,8 @@ Visual3d_View::Visual3d_View (const Handle(Visual3d_ViewManager)& theMgr)
myAutoZFitScaleFactor (1.0),
myStructuresUpdated (Standard_True)
{
myHiddenObjects = new Graphic3d_NMapOfTransient();
MyCView.ViewId = theMgr->Identification (this);
MyCView.Active = 0;
MyCView.IsDeleted = 0;
@@ -1735,6 +1737,7 @@ Bnd_Box Visual3d_View::MinMaxValues (const Graphic3d_MapOfStructure& theSet,
const Standard_Boolean theToIgnoreInfiniteFlag) const
{
Bnd_Box aResult;
const Standard_Integer aViewId = MyCView.ViewId;
for (Graphic3d_MapIteratorOfMapOfStructure aStructIter (theSet); aStructIter.More(); aStructIter.Next())
{
const Handle(Graphic3d_Structure)& aStructure = aStructIter.Key();
@@ -1742,6 +1745,11 @@ Bnd_Box Visual3d_View::MinMaxValues (const Graphic3d_MapOfStructure& theSet,
{
continue;
}
else if (!aStructIter.Value()->CStructure()->ViewAffinity.IsNull()
&& !aStructIter.Value()->CStructure()->ViewAffinity->IsVisible (aViewId))
{
continue;
}
addStructureBndBox (aStructure, theToIgnoreInfiniteFlag, aResult);
}
@@ -2690,3 +2698,21 @@ Standard_Boolean Visual3d_View::Print (const Handle(Visual3d_Layer)& theUnderLay
thePrintDC, theToShowBackground, theFilename,
thePrintAlgorithm, theScaleFactor);
}
//=============================================================================
//function : HiddenObjects
//purpose :
//=============================================================================
const Handle(Graphic3d_NMapOfTransient)& Visual3d_View::HiddenObjects() const
{
return myHiddenObjects;
}
//=============================================================================
//function : HiddenObjects
//purpose :
//=============================================================================
Handle(Graphic3d_NMapOfTransient)& Visual3d_View::ChangeHiddenObjects()
{
return myHiddenObjects;
}

View File

@@ -81,7 +81,7 @@
Visual3d_ViewManager::Visual3d_ViewManager (const Handle(Graphic3d_GraphicDriver)& theDriver):
Graphic3d_StructureManager (theDriver),
MyDefinedView (),
MyViewGenId (View_IDMIN+((View_IDMIN+View_IDMAX)/(Visual3d_ViewManager::Limit ()))*(Visual3d_ViewManager::CurrentId ()-1),View_IDMIN+((View_IDMIN+View_IDMAX)/(Visual3d_ViewManager::Limit ()))*Visual3d_ViewManager::CurrentId ()-1),
MyViewGenId (0, 31),
MyZBufferAuto (Standard_False),
myZLayerGenId (1, IntegerLast())
{