Fixed graphic structure recompute after closing view.
Removed collector and all corresponding logic and methods from AIS_InteractiveContext.
Method AIS_InteractiveContext::Erase() now hide object from viewer without deleting resources.
Erased objects now properly recomputed after closing view.
Samples update
Removed useless method AIS_InteractiveContext::EraseMode()
Documentation update
Warnings fix
Regressions fix
{
if (aDisplayType == No2D3D )
{
- aDoc->GetAISContext()->EraseAll(Standard_False);
+ aDoc->GetAISContext()->EraseAll();
aDoc->Put3DOnTop();
}
if (aDisplayType == a2D3D)
{
- aDoc->GetAISContext()->EraseAll(Standard_False);
+ aDoc->GetAISContext()->EraseAll();
aDoc->GetISessionContext()->EraseAll();
aDoc->Put3DOnTop(false);
aDoc->Put2DOnTop(false);
TopoDS_Shape ShapeCut = BRepAlgoAPI_Cut(theSphere,theBox);
-myAISContext->Erase(ais1,Standard_False,Standard_False);
-myAISContext->Erase(ais2,Standard_False,Standard_False);
+myAISContext->Erase(ais1,Standard_False);
+myAISContext->Erase(ais2,Standard_False);
Handle (AIS_Shape) aSection = new AIS_Shape(ShapeCut);
myAISContext->SetDisplayMode(aSection,1,Standard_False);
TopoDS_Shape FusedShape = BRepAlgoAPI_Fuse(theBox1,theBox2);
-myAISContext->Erase(ais1,Standard_True,Standard_False);
-myAISContext->Erase(ais2,Standard_True,Standard_False);
+myAISContext->Erase(ais1,Standard_True);
+myAISContext->Erase(ais2,Standard_True);
Handle (AIS_Shape) aFusion = new AIS_Shape(FusedShape);
myAISContext->SetDisplayMode(aFusion,1,Standard_False);
TopoDS_Shape theCommonSurface = BRepAlgoAPI_Common(theBox,theWedge);
-myAISContext->Erase(aboxshape,Standard_True,Standard_False);
-myAISContext->Erase(awedge,Standard_True,Standard_False);
+myAISContext->Erase(aboxshape,Standard_True);
+myAISContext->Erase(awedge,Standard_True);
Handle(AIS_Shape) acommon = new AIS_Shape(theCommonSurface);
myAISContext->SetColor(acommon,Quantity_NOC_GREEN,Standard_False);
Fit();
Sleep(500);
-myAISContext->Erase(ais1,Standard_True,Standard_False);
+myAISContext->Erase(ais1,Standard_True);
TCollection_AsciiString Message ("\
\n\
BRepFeat_Gluer glue(S2,S1);
glue.Bind(F2,F1);
TopoDS_Shape res1 = glue.Shape();
- myAISContext->Erase(ais2,Standard_False,Standard_False);
+ myAISContext->Erase(ais2,Standard_False);
ais1->Set(res1);
for (CommonEdges.InitIterator(); CommonEdges.More(); CommonEdges.Next())
glue2.Bind(CommonEdges.EdgeFrom(),CommonEdges.EdgeTo());
TopoDS_Shape res2 = glue2.Shape();
- myAISContext->Erase(ais3,Standard_False,Standard_False);
+ myAISContext->Erase(ais3,Standard_False);
ais4->Set(res2);
asplit.Build();
//Sleep(1000);
- myAISContext->Erase(ais1,Standard_False,Standard_False);
+ myAISContext->Erase(ais1,Standard_False);
//Fit();
TopoDS_Shape Result = asplit.Shape();
Fit();
Sleep(1000);
- myAISContext->Erase(abox1,Standard_True,Standard_False);
+ myAISContext->Erase(abox1,Standard_True);
Fit();
// (SDI documents will reuse this document)
SetTitle(myPresentation->GetName());
- myAISContext->EraseAll(Standard_False);
+ myAISContext->EraseAll();
myAISContext->SetDisplayMode(AIS_Shaded);
POSITION pos = GetFirstViewPosition();
void CViewer3dDoc::OnBUTTONStart()
{
- myAISContext->EraseAll(Standard_False);
+ myAISContext->EraseAll();
myPresentation->FirstSample();
DoSample();
}
void CViewer3dDoc::OnBUTTONEnd()
{
- myAISContext->EraseAll(Standard_False);
+ myAISContext->EraseAll();
myPresentation->LastSample();
DoSample();
}
void CTriangulationDoc::OnBUTTONStart()
{
- myAISContext->EraseAll(Standard_False);
+ myAISContext->EraseAll();
myPresentation->FirstSample();
DoSample();
}
void CTriangulationDoc::OnBUTTONEnd()
{
- myAISContext->EraseAll(Standard_False);
+ myAISContext->EraseAll();
myPresentation->LastSample();
DoSample();
}
UpdateProjector();
myDisplayableShape->SetNbIsos(m_NbIsos);
- myInteractiveContext->EraseAll(Standard_False);
+ myInteractiveContext->EraseAll();
myInteractiveContext->Display(myTrihedron);
Standard_Boolean OneOrMoreFound = Standard_False;
// (SDI documents will reuse this document)
SetTitle(myPresentation->GetName());
- myAISContext->EraseAll(Standard_False);
+ myAISContext->EraseAll();
myAISContext->SetDisplayMode(AIS_Shaded);
POSITION pos = GetFirstViewPosition();
void COCCDemoDoc::OnBUTTONStart()
{
- myAISContext->EraseAll(Standard_False);
+ myAISContext->EraseAll();
myPresentation->FirstSample();
DoSample();
}
void COCCDemoDoc::OnBUTTONEnd()
{
- myAISContext->EraseAll(Standard_False);
+ myAISContext->EraseAll();
myPresentation->LastSample();
DoSample();
}
void OCC_3dBaseDoc::OnObjectErase()
{
for(myAISContext->InitCurrent();myAISContext->MoreCurrent();myAISContext->NextCurrent())
- myAISContext->Erase(myAISContext->Current(),Standard_True,Standard_False);
+ myAISContext->Erase(myAISContext->Current(),Standard_True);
myAISContext->ClearCurrents();
}
void OCC_3dBaseDoc::OnUpdateObjectErase(CCmdUI* pCmdUI)
void OCC_3dBaseDoc::OnObjectDisplayall()
{
- myAISContext->DisplayAll(Standard_False);
+ myAISContext->DisplayAll();
}
void OCC_3dBaseDoc::OnUpdateObjectDisplayall(CCmdUI* pCmdUI)
else
{
Handle(Graphic3d_AspectMarker3d) aMarker = new Graphic3d_AspectMarker3d(myMarkerType,myColor,myIndex);
- aPresentation->SetPrimitivesAspect(aMarker);
+ Prs3d_Root::CurrentGroup (aPresentation)->SetPrimitivesAspect(aMarker);
Handle(Graphic3d_ArrayOfPoints) anArrayOfPoints = new Graphic3d_ArrayOfPoints (1);
anArrayOfPoints->AddVertex (myXPosition, myYPosition, 0);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray (anArrayOfPoints);
void DocumentCommon::onDelete()
{
for ( myContext->InitCurrent(); myContext->MoreCurrent(); myContext->NextCurrent() )
- myContext->Erase( myContext->Current(), false, true );
+ myContext->Erase( myContext->Current(), false);
myContext->ClearSelected();
getApplication()->onSelectionChanged();
}
}
// Display the voxels
- myViewer->getIC()->EraseAll(false, false);
+ myViewer->getIC()->EraseAll(false);
Voxel_DS* ds = myBoolVoxels;
if (!ds)
ds = myColorVoxels;
// Display
- myViewer->getIC()->EraseAll(false, false);
+ myViewer->getIC()->EraseAll(false);
initPrs();
myVoxels->SetBoolVoxels(0);
myVoxels->SetColorVoxels(0);
}
}
- myViewer->getIC()->EraseAll(false, false);
+ myViewer->getIC()->EraseAll(false);
Voxel_DS* ds = myBoolVoxels;
if (!ds)
void Application::displayWaves()
{
- myViewer->getIC()->EraseAll(false, false);
+ myViewer->getIC()->EraseAll(false);
// Make voxels
if (myBoolVoxels)
void Application::load(const TopoDS_Shape& S)
{
- myViewer->getIC()->EraseAll(false, false);
+ myViewer->getIC()->EraseAll(false);
// Delete voxels of previous shape.
if (myBoolVoxels)
void Application::displayCut()
{
- myViewer->getIC()->EraseAll(false, false);
+ myViewer->getIC()->EraseAll(false);
// Make a sphere with a lot of toruses,
// cut the toruses from the sphere.
void Application::displayCollisions()
{
- myViewer->getIC()->EraseAll(false, false);
+ myViewer->getIC()->EraseAll(false);
// Make a big box with a lot of small spheres inside.
double x = 0.0, y = 0.0, z = 0.0, xlen = 100.0, ylen = 100.0, zlen = 100.0, r = 10.0;
enumeration DisplayStatus is
DS_Displayed,
DS_Erased,
- DS_FullErased,
DS_Temporary,
DS_None;
---Purpose:
---Purpose:
-- Constructs the interactive context object defined by
-- the principal viewer MainViewer.
-
- Create(MainViewer,Collector: Viewer from V3d)
- returns mutable InteractiveContext from AIS;
- ---Purpose:
- -- Constructs the interactive context object defined by
- -- the principal viewer MainViewer and the collector
- -- (or trash) viewer.
-
Delete(me) is redefined;
- IsCollectorClosed(me) returns Boolean from Standard;
- ---C++: inline
- CloseCollector(me:mutable);
- ---C++: inline
- OpenCollector(me:mutable);
-
-
-
---Category: General DISPLAY SERVICES
SetAutoActivateSelection( me: mutable; Auto : Boolean from Standard );
GetAutoActivateSelection( me ) returns Boolean from Standard;
Erase(me : mutable;
aniobj : InteractiveObject from AIS;
- updateviewer : Boolean from Standard = Standard_True;
- PutInCollector : Boolean from Standard = Standard_False);
----Purpose: To erase presentations in current local context, or
--- failing that, in other local contexts which allow erasing.
---
--- If putinCollector is True, the object is erased with graphical status Erased,
--- and put into the Collector. These objects can be retrieved
--- from Interactive Context by ObjectsInCollector method.
--- If putinCollector is False, the objects erased with graphical status FullErased,
--- and not put into the Collector. These objects can be retrieved
--- from Interactive Context by ErasedObjects method.
---
--- Note: objects that are put into the Collector recomute their presentation
--- for Collector Presentation Manager.
---
--- If a local context is open and if updateviewer is
--- False, the presentation of the Interactive
--- Object activates the selection mode; the object is
--- displayed but no viewer will be updated.
-
- EraseMode(me : mutable;
- aniobj : InteractiveObject from AIS;
- aMode : Integer from Standard;
- updateviewer : Boolean from Standard = Standard_True);
- ---Purpose: Updates viewer contents and returns the display
--- mode of each aniobj object. Use only if more than
--- one display mode is active in the main viewer.
--- This method works only on presentation modes other
--- than the default mode. Nothing is done if aMode is
--- the default presentation mode.
--- If a local context is open and if updateviewer equals
--- Standard_False, the presentation of the Interactive
--- Object activates the selection mode; the object is
--- displayed but no viewer will be updated.
-
-
-
- EraseAll(me:mutable;
- PutInCollector : Boolean from Standard = Standard_False;
- updateviewer : Boolean from Standard = Standard_True);
- ---Purpose: Every erased object goes into the Collector viewer,
- -- depending on PutInCollector value.
-
- DisplayAll(me : mutable;
- OnlyFromCollector : Boolean from Standard = Standard_False;
- updateviewer : Boolean from Standard = Standard_True);
- ---Purpose: Displays all erased objects or display all objects from collector
-
- DisplayFromCollector(me : mutable;
- anIObj : InteractiveObject from AIS;
- updateviewer : Boolean from Standard = Standard_True);
- ---Purpose: display anIObj from the collector.
-
- EraseSelected(me:mutable;
- PutInCollector:Boolean from Standard=Standard_False;
- updateviewer:Boolean from Standard = Standard_True);
+ updateviewer : Boolean from Standard = Standard_True);
+---Purpose: Hides the object. The object's presentations are simply
+-- flagged as invisible and therefore excluded from redrawing.
+-- To show hidden objects, use Display().
+
+ EraseAll (me : mutable;
+ updateviewer: Boolean from Standard = Standard_True);
+ ---Purpose: Hides all objects. The object's presentations are simply
+-- flagged as invisible and therefore excluded from redrawing.
+-- To show all hidden objects, use DisplayAll().
+
+ DisplayAll(me : mutable;
+ updateviewer: Boolean from Standard = Standard_True);
+ ---Purpose: Displays all hidden objects.
+
+ EraseSelected(me: mutable;
+ updateviewer: Boolean from Standard = Standard_True);
---Purpose:
--- Erases selected objects if there is no open active local context.
--- If there is no local context activated and if
--- updateviewer equals Standard_False, the
--- presentation of the Interactive Object activates the
--- selection mode; the object is displayed but no viewer
--- will be updated.
--- If a local context is open, this method is neutral.
+-- Hides selected objects. The object's presentations are simply
+-- flagged as invisible and therefore excluded from redrawing.
+-- To show hidden objects, use Display().
DisplaySelected(me:mutable;updateviewer:Boolean from Standard = Standard_True);
---Purpose: Displays selected objects if a local context is open.
---Purpose: Returns the display status of the entity anIobj.
-- This will be one of the following:
-- - DS_Displayed displayed in main viewer
--- - DS_Erased erased in the Collector
--- - DS_FullErased erased everywhere but in the Collector
+-- - DS_Erased hidden in main viewer
-- - DS_Temporary temporarily displayed
-- - DS_None nowhere displayed.
-- <WithColor> will be returned TRUE
-- <theHiCol> gives the name of the hilightcolor
- IsInCollector(me;anIObj:InteractiveObject from AIS)
- returns Boolean from Standard;
----Purpose:
--- Returns true if the entity anIobj is in the Collector viewer.
-
DisplayPriority(me;anIobj: InteractiveObject from AIS)
returns Integer from Standard;
---Purpose:
-- Returns the display priority of the entity anIobj. This
-- will be display mode of anIobj if it is in the main
--- viewer, and the highlight mode if it is in the Collector viewer.
+-- viewer.
HasColor(me; aniobj: InteractiveObject from AIS)
returns Boolean from Standard;
-- are called current objects; those selected in open
-- local context, selected objects.
- UpdateCollector(me:mutable);
----Purpose: Updates the Collector viewer.
-
-
-
---Category: General Attributes for the session
DisplayMode(me) returns Integer from Standard;
-- is changed.
-- When <globalChange> is FALSE , only the current group
-- of the object presentation is changed.
- -- Updates the viewer or collector when <updateViewer> is TRUE
+ -- Updates the viewer when <updateViewer> is TRUE
---Category: Graphic attributes management
---Category: GRAPHIC DETECTION / SELECTION
-- by Default, <WhichSignature> = -1 means
-- control only on <WhichKind>.
- Collector(me) returns any Viewer from V3d;
- ---C++: return const &
- ---C++: inline
-
- ObjectsInCollector (me;aListOfIO : in out ListOfInteractive from AIS);
- ---Purpose:
- -- Returns the list aListOfIO of erased objects of a
- -- particular Type WhichKind and Signature WhichSignature.
- -- By Default, WhichSignature equals 1. This means
- -- that there is a check on type only.
-
- ObjectsInCollector (me;
- WhichKind :KindOfInteractive from AIS;
- WhichSignature :Integer from Standard;
- aListOfIO : in out ListOfInteractive from AIS);
- ---Purpose: gives the list of erased objects of a particular
- -- Type and signature
- -- by Default, <WhichSignature> = -1 means
- -- control only on <WhichKind>.
-
-
ErasedObjects (me;theListOfIO : in out ListOfInteractive from AIS);
---Purpose:
- -- Returns the list theListOfIO of erased objects (but not placed into collecter)
+ -- Returns the list theListOfIO of erased objects (hidden objects)
-- particular Type WhichKind and Signature WhichSignature.
-- By Default, WhichSignature equals 1. This means
-- that there is a check on type only.
WhichKind :KindOfInteractive from AIS;
WhichSignature :Integer from Standard;
theListOfIO : in out ListOfInteractive from AIS);
- ---Purpose: gives the list of erased objects (but not placed into collecter)
+ ---Purpose: gives the list of erased objects (hidden objects)
-- Type and signature
-- by Default, <WhichSignature> = -1 means
-- control only on <WhichKind>.
DomainOfMainViewer(me) returns CString from Standard;
---Purpose: Returns the domain name of the main viewer.
- DomainOfCollector(me) returns CString from Standard;
- ---Purpose: Returns the domain name of the Collector viewer.
-
+
---Category: Internal
---Category: Internal
MainPrsMgr (me) returns any PresentationManager3d from PrsMgr;
---C++: inline
---C++: return const &
- CollectorPrsMgr(me) returns any PresentationManager3d from PrsMgr;
- ---C++: inline
- ---C++: return const &
-
MainSelector(me) returns any ViewerSelector3d from StdSelect;
---C++: inline
---C++: return const &
LocalSelector(me) returns any ViewerSelector3d from StdSelect;
-
- CollectorSelector(me) returns any ViewerSelector3d from StdSelect;
- ---C++: inline
- ---C++: return const &
-
-
-
- PurgeDisplay(me:mutable;CollectorToo:Boolean from Standard = Standard_False)
+ PurgeDisplay(me:mutable)
returns Integer from Standard;
---Level: Internal
---Purpose: Clears all the structures which don't
EraseGlobal(me : mutable;
- anObj : InteractiveObject from AIS;
- updateviewer : Boolean from Standard = Standard_True;
- PutInCollector : Boolean from Standard = Standard_False) is static private;
+ anObj : InteractiveObject from AIS;
+ updateviewer : Boolean from Standard = Standard_True) is static private;
ClearGlobal(me : mutable;
anObj : InteractiveObject from AIS;
myMainVwr : Viewer from V3d;
myMainSel : ViewerSelector3d from StdSelect;
- myCollectorPM : PresentationManager3d from PrsMgr;
- myCollectorVwr : Viewer from V3d;
- myCollectorSel : ViewerSelector3d from StdSelect;
-
- myIsCollClosed : Boolean from Standard;
-
-- the selection and current objects.
mySelectionName : AsciiString from TCollection;
myLastPicked : InteractiveObject from AIS;
myLastinMain : InteractiveObject from AIS;
- myLastinColl : InteractiveObject from AIS;
myWasLastMain : Boolean from Standard;
myMainPM(new PrsMgr_PresentationManager3d(MainViewer->Viewer())),
myMainVwr(MainViewer),
myMainSel(new StdSelect_ViewerSelector3d()),
-myIsCollClosed(Standard_True),
myToHilightSelected( Standard_False ),
myFilters(new SelectMgr_OrFilter()),
myDefaultDrawer(new Prs3d_Drawer()),
InitAttributes();
}
-
-//=======================================================================
-//function : AIS_InteractiveContext
-//purpose :
-//=======================================================================
-
-AIS_InteractiveContext::AIS_InteractiveContext(const Handle(V3d_Viewer)& MainViewer,
- const Handle(V3d_Viewer)& Collector):
-mgrSelector(new SelectMgr_SelectionManager()),
-myMainPM(new PrsMgr_PresentationManager3d(MainViewer->Viewer())),
-myMainVwr(MainViewer),
-myMainSel(new StdSelect_ViewerSelector3d()),
-myCollectorPM(new PrsMgr_PresentationManager3d(Collector->Viewer())),
-myCollectorVwr(Collector),
-myCollectorSel(new StdSelect_ViewerSelector3d()),
-myIsCollClosed(Standard_False),
-myToHilightSelected( Standard_False ),
-myFilters(new SelectMgr_OrFilter()),
-myDefaultDrawer(new Prs3d_Drawer()),
-myDefaultColor(Quantity_NOC_GOLDENROD),
-myHilightColor(Quantity_NOC_CYAN1),
-mySelectionColor(Quantity_NOC_GRAY80),
-myPreselectionColor(Quantity_NOC_GREEN),
-mySubIntensity(Quantity_NOC_GRAY40),
-myDisplayMode(0),
-myCurLocalIndex(0),
-#ifdef IMP051001
-myZDetectionFlag(0),
-#endif
-myIsAutoActivateSelMode( Standard_True )
-{
- InitAttributes();
- mgrSelector->Add(myCollectorSel);
- SetPixelTolerance();
-}
-
void AIS_InteractiveContext::Delete() const
{
#ifdef OCC172
myMainVwr->Update();
}
-void AIS_InteractiveContext::OpenCollector()
-{
- myIsCollClosed = Standard_False;
- // to be completed....
-}
-
-
//=======================================================================
//function : DomainOfMainViewer
ObjectsByDisplayStatus( TheKind, TheSign, AIS_DS_Displayed, aListOfIO );
}
-//=======================================================================
-//function : UpdateCollector
-//purpose :
-//=======================================================================
-
-void AIS_InteractiveContext::UpdateCollector()
-{
- if (!myCollectorVwr.IsNull())
- myCollectorVwr->Update();
-}
-
-//=======================================================================
-//function : DomainOfCollector
-//purpose :
-//=======================================================================
-
-Standard_CString AIS_InteractiveContext::DomainOfCollector() const
-{
- if(myCollectorVwr.IsNull()) return "";
- return myCollectorVwr->Domain();
-}
-
-//=======================================================================
-//function : ObjectsInCollector
-//purpose :
-//=======================================================================
-
-void AIS_InteractiveContext::ObjectsInCollector(AIS_ListOfInteractive& aListOfIO) const
-{
- ObjectsByDisplayStatus( AIS_DS_Erased, aListOfIO );
-}
-
-//=======================================================================
-//function : ObjectsInCollector
-//purpose :
-//=======================================================================
-
-void AIS_InteractiveContext::ObjectsInCollector(const AIS_KindOfInteractive TheKind,
- const Standard_Integer TheSign,
- AIS_ListOfInteractive& aListOfIO) const
-{
- ObjectsByDisplayStatus( TheKind, TheSign, AIS_DS_Erased, aListOfIO );
-}
-
//=======================================================================
//function : ErasedObjects
//purpose :
void AIS_InteractiveContext::ErasedObjects(AIS_ListOfInteractive& theListOfIO) const
{
- ObjectsByDisplayStatus( AIS_DS_FullErased, theListOfIO );
+ ObjectsByDisplayStatus( AIS_DS_Erased, theListOfIO );
}
//=======================================================================
const Standard_Integer TheSign,
AIS_ListOfInteractive& theListOfIO) const
{
- ObjectsByDisplayStatus( TheKind, TheSign, AIS_DS_FullErased, theListOfIO );
+ ObjectsByDisplayStatus( TheKind, TheSign, AIS_DS_Erased, theListOfIO );
}
//=======================================================================
// SAN : Do not return here. Perform advanced display mode analysis a bit later...
if(IsDisplayed(anIObj)) return;
#endif
- Standard_Boolean updcol = Standard_False;
-
+
// it did not yet exist
if(!myObjects.IsBound(anIObj)){
// const Handle(AIS_GlobalStatus)& STATUS = myObjects(anIObj);
Handle(AIS_GlobalStatus) STATUS = myObjects(anIObj);
// ENDCLE
- switch (STATUS->GraphicStatus()){
- case AIS_DS_Erased:{
- if(STATUS->IsHilighted())
- myCollectorPM->Unhighlight(anIObj,HiMod);
- myCollectorPM->Erase(anIObj,HiMod);
- mgrSelector->Deactivate(anIObj,myCollectorSel);
- updcol = updateviewer;
- }// attention the break is not set on purpose...
- case AIS_DS_FullErased:{
- TColStd_ListIteratorOfListOfInteger ItL (STATUS->DisplayedModes());
- for (;ItL.More();ItL.Next()){
- myMainPM->Display(anIObj,ItL.Value());
- if(STATUS->IsSubIntensityOn())
- myMainPM->Color(anIObj,mySubIntensity,ItL.Value());
- }
- if( myIsAutoActivateSelMode )
- for (ItL.Initialize(STATUS->SelectionModes());ItL.More();ItL.Next())
- mgrSelector->Activate(anIObj,ItL.Value(),myMainSel);
- STATUS->SetGraphicStatus(AIS_DS_Displayed);
- if(STATUS->IsHilighted())
- myMainPM->Highlight(anIObj,HiMod);
- break;
- }
-#ifdef OCC4373
- // SAN : erase presentations for all display modes different from <DispMode>;
- // then make sure <DispMode> is displayed and maybe highlighted;
- // Finally, activate selection mode <SelMode> if not yet activated.
- case AIS_DS_Displayed:{
+ if (STATUS->GraphicStatus() == AIS_DS_Displayed || STATUS->GraphicStatus() == AIS_DS_Erased)
+ {
+ // SAN : erase presentations for all display modes different from <DispMode>;
+ // then make sure <DispMode> is displayed and maybe highlighted;
+ // Finally, activate selection mode <SelMode> if not yet activated.
TColStd_ListOfInteger aModesToRemove;
TColStd_ListIteratorOfListOfInteger ItL (STATUS->DisplayedModes());
for(;ItL.More();ItL.Next()){
STATUS->AddDisplayMode(DispMode);
myMainPM->Display(anIObj,DispMode);
+ if (STATUS->GraphicStatus() == AIS_DS_Erased)
+ {
+ STATUS->SetGraphicStatus(AIS_DS_Displayed);
+ }
if(STATUS->IsHilighted()){
myMainPM->Highlight(anIObj,HiMod);
}
if(!mgrSelector->IsActivated(anIObj,SelMode))
mgrSelector->Activate(anIObj,SelMode,myMainSel);
}
-
- break;
- }
-#endif
- default:
- break;
}
}
if(anIObj->IsTransparent() && !myMainVwr->Viewer()->Transparency())
myMainVwr->Viewer()->SetTransparency(Standard_True);
if(updateviewer) myMainVwr->Update();
- if(updcol && !myCollectorVwr.IsNull()) myCollectorVwr->Update();
}
// LOCAL CONTEXT OPEN
GetDefModes(anIObj,DispMode,HiMod,SelModeDef);
Handle(AIS_GlobalStatus) STATUS=
- new AIS_GlobalStatus(AIS_DS_FullErased,DispMode,SelModeDef);
+ new AIS_GlobalStatus(AIS_DS_Erased,DispMode,SelModeDef);
myObjects.Bind (anIObj,STATUS);
return;
}
//=======================================================================
void AIS_InteractiveContext::Erase(const Handle(AIS_InteractiveObject)& anIObj,
- const Standard_Boolean updateviewer,
- const Standard_Boolean PutInCollector)
+ const Standard_Boolean updateviewer)
{
if(anIObj.IsNull()) return;
anIObj->ClearSelected();
if(!HasOpenedContext()){
- EraseGlobal(anIObj,updateviewer,PutInCollector);
+ EraseGlobal(anIObj,updateviewer);
}
else
{
}
if(!WasInCtx)
- EraseGlobal(anIObj,updateviewer,PutInCollector);
+ EraseGlobal(anIObj,updateviewer);
else
if(updateviewer) myMainVwr->Update();
}
}
-//=======================================================================
-//function : Erase
-//purpose :
-//=======================================================================
-
-void AIS_InteractiveContext::EraseMode(const Handle(AIS_InteractiveObject)& anIObj,
- const Standard_Integer aMode,
- const Standard_Boolean /*updateviewer*/)
-{
- if(anIObj.IsNull()) return;
-
- if(!myObjects.IsBound(anIObj)) return;
-
- if(anIObj->HasDisplayMode()){
- if(anIObj->DisplayMode()==aMode) return;
- }
- else if(myDisplayMode==aMode) return;
- // CLE
- // const Handle(AIS_GlobalStatus)& STATUS = myObjects(anIObj);
- Handle(AIS_GlobalStatus) STATUS = myObjects(anIObj);
- // ENDCLE
- if(STATUS->GraphicStatus()!=AIS_DS_Displayed) return;
-
-
-// if(STATUS->IsDModeIn(aMode)) {}
-}
-
-
//=======================================================================
//function : EraseAll
//purpose :
//=======================================================================
-void AIS_InteractiveContext::EraseAll(const Standard_Boolean PutInCollector,
- const Standard_Boolean updateviewer)
+void AIS_InteractiveContext::EraseAll(const Standard_Boolean updateviewer)
{
- if(!HasOpenedContext()){
- AIS_DataMapIteratorOfDataMapOfIOStatus ItM(myObjects);
-
- for(;ItM.More();ItM.Next()){
+ if(!HasOpenedContext())
+ {
+ for (AIS_DataMapIteratorOfDataMapOfIOStatus ItM(myObjects); ItM.More(); ItM.Next())
+ {
if(ItM.Value()->GraphicStatus() == AIS_DS_Displayed)
- Erase(ItM.Key(),Standard_False,PutInCollector);
+ Erase(ItM.Key(),Standard_False);
}
- if(updateviewer){
+ if(updateviewer)
+ {
myMainVwr->Update();
- if (PutInCollector && !myCollectorVwr.IsNull())
- myCollectorVwr->Update();
}
}
-
}
//=======================================================================
//purpose :
//=======================================================================
-void AIS_InteractiveContext::DisplayAll(const Standard_Boolean OnlyFromCollector,
- const Standard_Boolean updateviewer)
+void AIS_InteractiveContext::DisplayAll(const Standard_Boolean updateviewer)
{
if(!HasOpenedContext()){
- Standard_Boolean FoundInCollector(Standard_False);
- AIS_DisplayStatus aDStatus = OnlyFromCollector ? AIS_DS_Erased : AIS_DS_FullErased,TheStatus;
- if(!HasOpenedContext()){
- AIS_DataMapIteratorOfDataMapOfIOStatus ItM(myObjects);
-
- for(;ItM.More();ItM.Next()){
- TheStatus = ItM.Value()->GraphicStatus();
- if(TheStatus == aDStatus)
+ AIS_DisplayStatus aStatus;
+
+ if (!HasOpenedContext())
+ {
+ for (AIS_DataMapIteratorOfDataMapOfIOStatus ItM (myObjects); ItM.More(); ItM.Next())
+ {
+ aStatus = ItM.Value()->GraphicStatus();
+ if (aStatus == AIS_DS_Erased)
Display(ItM.Key(),Standard_False);
- if(TheStatus == AIS_DS_Erased)
- FoundInCollector = Standard_True;
}
- if(updateviewer){
+ if(updateviewer)
+ {
myMainVwr->Update();
- if(FoundInCollector && !myCollectorVwr.IsNull())
- myCollectorVwr->Update();
}
}
}
void AIS_InteractiveContext::DisplaySelected(const Standard_Boolean updateviewer)
{
- if(!HasOpenedContext()){
+ if (!HasOpenedContext())
+ {
Standard_Boolean found = Standard_False;
Handle(AIS_Selection) sel = AIS_Selection::Selection(myCurrentName.ToCString());
Handle(AIS_InteractiveObject) iObj;
- for (sel->Init();sel->More();sel->Next()) {
+ for (sel->Init(); sel->More(); sel->Next())
+ {
iObj = Handle(AIS_InteractiveObject)::DownCast(sel->Value());
Display(iObj,Standard_False);
found = Standard_True;
}
- if(found && updateviewer) {
+ if (found && updateviewer)
+ {
myMainVwr->Update();
- if(!(myIsCollClosed && myCollectorVwr.IsNull()))
-
- myCollectorVwr->Update();
}
}
}
//purpose :
//=======================================================================
-void AIS_InteractiveContext::EraseSelected(const Standard_Boolean PutInCollector,
- const Standard_Boolean updateviewer)
+void AIS_InteractiveContext::EraseSelected(const Standard_Boolean updateviewer)
{
-
- if(!HasOpenedContext()){
+ if (!HasOpenedContext())
+ {
Standard_Boolean found = Standard_False;
Handle(AIS_Selection) sel = AIS_Selection::Selection(myCurrentName.ToCString());
Handle(AIS_InteractiveObject) iObj;
- for(sel->Init();sel->More();sel->Next()) {
+ for (sel->Init();sel->More();sel->Next())
+ {
iObj = Handle(AIS_InteractiveObject)::DownCast(sel->Value());
- Erase(iObj,Standard_False,PutInCollector);
+ Erase(iObj,Standard_False);
found = Standard_True;
}
- if(found && updateviewer) {
+ if(found && updateviewer)
+ {
myMainVwr->Update();
- if(PutInCollector && !myCollectorVwr.IsNull())
- myCollectorVwr->Update();
}
}
}
if(!anIObj->HasInteractiveContext()) anIObj->SetContext(this);
if (!HasOpenedContext())
- {
- if(!myObjects.IsBound(anIObj)) return;
+ {
+ if(!myObjects.IsBound(anIObj)) return;
- // CLE
- // const Handle(AIS_GlobalStatus)& STATUS = myObjects(anIObj);
- // const TColStd_ListOfInteger& LL = STATUS->DisplayedModes();
- Handle(AIS_GlobalStatus) STATUS = myObjects(anIObj);
+ // CLE
+ // const Handle(AIS_GlobalStatus)& STATUS = myObjects(anIObj);
+ // const TColStd_ListOfInteger& LL = STATUS->DisplayedModes();
+ Handle(AIS_GlobalStatus) STATUS = myObjects(anIObj);
- // ENDCLE
- STATUS->SetHilightStatus (Standard_True);
-
- switch(STATUS->GraphicStatus()){
- case AIS_DS_Displayed:
- {
- Standard_Integer DispMode,HiMode,SelMode;
- GetDefModes(anIObj,DispMode,HiMode,SelMode);
-// if(!STATUS->IsDModeIn(HiMode)){
-// myMainPM->Display(anIObj,HiMode);
-// }
- myMainPM->Highlight(anIObj,HiMode);
- if(updateviewer) myMainVwr->Update();
- break;
- }
- case AIS_DS_Erased:
- {
- Standard_Integer HiMode = anIObj->HasHilightMode()? anIObj->HilightMode():0;
- myCollectorPM->Highlight(anIObj,HiMode);
- if(updateviewer) myCollectorVwr->Update();
- break;
- }
- default:
- break;
- }
+ // ENDCLE
+ STATUS->SetHilightStatus (Standard_True);
+
+ if (STATUS->GraphicStatus() == AIS_DS_Displayed)
+ {
+ Standard_Integer aHilightMode = anIObj->HasHilightMode() ? anIObj->HilightMode() : 0;
+ myMainPM->Highlight (anIObj, aHilightMode);
}
+ }
else
+ {
myLocalContexts(myCurLocalIndex)->Hilight(anIObj);
+ }
+
if(updateviewer) myMainVwr->Update();
}
//=======================================================================
if(!anIObj->HasInteractiveContext()) anIObj->SetContext(this);
if (!HasOpenedContext())
- {
- if(!myObjects.IsBound(anIObj)) return;
+ {
+ if(!myObjects.IsBound(anIObj)) return;
- const Handle(AIS_GlobalStatus)& STATUS = myObjects(anIObj);
- STATUS->SetHilightStatus (Standard_True);
-
- switch(STATUS->GraphicStatus()){
- case AIS_DS_Displayed:
- {
- Standard_Integer DispMode,HiMode,SelMode;
- GetDefModes(anIObj,DispMode,HiMode,SelMode);
-// if(!STATUS->IsDModeIn(HiMode)){
-// myMainPM->Display(anIObj,HiMode);
-// }
- myMainPM->Color(anIObj,aCol,HiMode);
- STATUS->SetHilightColor(aCol);
- if(updateviewer) myMainVwr->Update();
- break;
- }
- case AIS_DS_Erased:
- {
- Standard_Integer HiMode = anIObj->HasHilightMode()? anIObj->HilightMode():0;
- myCollectorPM->Color(anIObj,aCol,HiMode);
- if(updateviewer) myCollectorVwr->Update();
- break;
- }
- default:
- break;
- }
+ const Handle(AIS_GlobalStatus)& STATUS = myObjects(anIObj);
+ STATUS->SetHilightStatus (Standard_True);
+
+ if (STATUS->GraphicStatus() == AIS_DS_Displayed)
+ {
+ Standard_Integer aHilightMode = anIObj->HasHilightMode() ? anIObj->HilightMode() : 0;
+ myMainPM->Color (anIObj, aCol, aHilightMode);
+ STATUS->SetHilightColor (aCol);
}
+ }
else
+ {
myLocalContexts(myCurLocalIndex)->Hilight(anIObj,aCol);
+ }
if(updateviewer) myMainVwr->Update();
}
if(anIObj.IsNull()) return;
if (!HasOpenedContext())
- {
- if(!myObjects.IsBound(anIObj)) return;
+ {
+ if(!myObjects.IsBound(anIObj)) return;
- const Handle(AIS_GlobalStatus)& STATUS = myObjects(anIObj);
- STATUS->SetHilightStatus (Standard_False);
- STATUS->SetHilightColor(Quantity_NOC_WHITE);
-
- switch(STATUS->GraphicStatus()){
- case AIS_DS_Displayed:
- {
- Standard_Integer DispMode,HiMode,SelMode;
- GetDefModes(anIObj,DispMode,HiMode,SelMode);
- myMainPM->Unhighlight(anIObj,HiMode);
-// if(!STATUS->IsDModeIn(HiMode))
-// myMainPM->Erase(anIObj,HiMode);
- if(updateviewer) myMainVwr->Update();
- break;
- }
- case AIS_DS_Erased:
- {
- Standard_Integer HiMode = anIObj->HasHilightMode()? anIObj->HilightMode():0;
- myCollectorPM->Unhighlight(anIObj,HiMode);
- if(updateviewer) myCollectorVwr->Update();
- break;
- }
- default:
- break;
- }
+ const Handle(AIS_GlobalStatus)& STATUS = myObjects(anIObj);
+ STATUS->SetHilightStatus (Standard_False);
+ STATUS->SetHilightColor(Quantity_NOC_WHITE);
+
+ if (STATUS->GraphicStatus() == AIS_DS_Displayed)
+ {
+ Standard_Integer aHilightMode = anIObj->HasHilightMode() ? anIObj->HilightMode() : 0;
+ myMainPM->Unhighlight (anIObj, aHilightMode);
}
+ }
else
+ {
myLocalContexts(myCurLocalIndex)->Unhilight(anIObj);
+ }
if(updateviewer) myMainVwr->Update();
}
return Standard_False;
}
-//=======================================================================
-//function : IsDisplayed
-//purpose :
-//=======================================================================
-
-Standard_Boolean AIS_InteractiveContext::IsInCollector(const Handle(AIS_InteractiveObject)& anIObj) const
-{
- if(anIObj.IsNull()) return Standard_False;
-
-
- if(myObjects.IsBound(anIObj))
- return (myObjects(anIObj)->GraphicStatus()==AIS_DS_Erased);
- return Standard_False;
-}
-
//=======================================================================
//function : IsDisplayed
DisplayPriority(const Handle(AIS_InteractiveObject)& anIObj) const
{
if(anIObj.IsNull()) return -1;
- if(myObjects.IsBound(anIObj)){
- // CLE
- // const Handle(AIS_GlobalStatus) & STATUS = myObjects(anIObj);
+
+ if (myObjects.IsBound(anIObj))
+ {
Handle(AIS_GlobalStatus) STATUS = myObjects(anIObj);
- // ENDCLE
- Standard_Integer DM,HM,SM ;
- GetDefModes(anIObj,DM,HM,SM);
- switch(STATUS->GraphicStatus()){
- case AIS_DS_Displayed:
- {
- return myMainPM->DisplayPriority(anIObj,DM);
- break;
- }
- case AIS_DS_Erased:
- return myCollectorPM->DisplayPriority(anIObj,HM);
- default:
- break;
+ if (STATUS->GraphicStatus() == AIS_DS_Displayed || STATUS->GraphicStatus() == AIS_DS_Erased)
+ {
+ Standard_Integer aDispMode = anIObj->HasDisplayMode() ? anIObj->DisplayMode() :
+ (anIObj->AcceptDisplayMode(myDisplayMode)? myDisplayMode : 0);
+ return myMainPM->DisplayPriority (anIObj, aDispMode);
}
- return 0;
}
return 0;
}
return;
if(!anIObj->HasInteractiveContext())
anIObj->SetContext(this);
- if(myObjects.IsBound(anIObj)){
- // CLE
- // const Handle(AIS_GlobalStatus) & STATUS = myObjects(anIObj);
+ if(myObjects.IsBound(anIObj))
+ {
Handle(AIS_GlobalStatus) STATUS = myObjects(anIObj);
- // ENDCLE
- Standard_Integer DM,HM,SM ;
- GetDefModes(anIObj,DM,HM,SM);
- switch(STATUS->GraphicStatus()){
- case AIS_DS_Displayed:
- {
- myMainPM->SetDisplayPriority(anIObj,DM,aPriority);
- break;
- }
- case AIS_DS_Erased:
- {
- myCollectorPM->SetDisplayPriority(anIObj,HM,aPriority);
- break;
- }
- default:
- break;
+
+ if (STATUS->GraphicStatus() == AIS_DS_Displayed || STATUS->GraphicStatus() == AIS_DS_Erased)
+ {
+ Standard_Integer aDisplayMode = anIObj->HasDisplayMode() ? anIObj->DisplayMode() :
+ (anIObj->AcceptDisplayMode(myDisplayMode)? myDisplayMode : 0);
+ myMainPM->SetDisplayPriority (anIObj, aDisplayMode, aPriority);
}
}
else if (HasOpenedContext())
- {myLocalContexts(myCurLocalIndex)->SetDisplayPriority(anIObj,aPriority);}
+ {
+ myLocalContexts(myCurLocalIndex)->SetDisplayPriority(anIObj,aPriority);
+ }
}
//=======================================================================
const Standard_Integer /*Sign*/,
const Standard_Boolean updateviewer)
{
- Standard_Boolean found_viewer(Standard_False),found_coll(Standard_False);
+ Standard_Boolean found_viewer(Standard_False);
// update
for(AIS_DataMapIteratorOfDataMapOfIOStatus It(myObjects);It.More();It.Next()){
// CLE
// ((IO->Signature()==Sign)? Standard_True:Standard_False);
#endif
Redisplay(IO,Standard_False);
- switch(It.Value()->GraphicStatus()){
- case AIS_DS_Displayed:
+ if (It.Value()->GraphicStatus() == AIS_DS_Displayed)
+ {
found_viewer = Standard_True;
- break;
- case AIS_DS_Erased:
- found_coll = Standard_True;
- break;
- default:
- break;
}
}
}
// update viewer...
- if(updateviewer){
- if(found_viewer)
- myMainVwr->Update();
- if(found_coll)
- myCollectorVwr->Update();
+ if(updateviewer && found_viewer)
+ {
+ myMainVwr->Update();
}
}
{
if(anIObj.IsNull()) return;
anIObj->Update(allmodes);
-
- if(updateviewer) {
- if(HasOpenedContext())
- myMainVwr->Update();
- else{
- if(myObjects.IsBound(anIObj)){
- switch(myObjects(anIObj)->GraphicStatus()){
- case AIS_DS_Displayed:
- myMainVwr->Update();
- break;
- case AIS_DS_Erased:
- {
- if(!myCollectorVwr.IsNull())
- myCollectorVwr->Update();
- }
- default:
- break;
- }
- }
- }
+
+ if (!updateviewer)
+ {
+ return;
+ }
+
+ if (HasOpenedContext() ||
+ (myObjects.IsBound(anIObj) && myObjects(anIObj)->GraphicStatus() == AIS_DS_Displayed))
+ {
+ myMainVwr->Update();
}
}
//=======================================================================
ActivatedModes(anIObj,LI);
if(!HasOpenedContext()){
if(!myObjects.IsBound(anIObj)) return;
- switch(myObjects(anIObj)->GraphicStatus())
+
+ if (myObjects(anIObj)->GraphicStatus() == AIS_DS_Displayed)
+ {
+ for(Lit.Initialize(LI);Lit.More();Lit.Next())
{
- case AIS_DS_Displayed:
- {
- for(Lit.Initialize(LI);Lit.More();Lit.Next())
- mgrSelector->Activate(anIObj,Lit.Value(),myMainSel);
- break;
- }
- case AIS_DS_Erased:
- {
- for(Lit.Initialize(LI);Lit.More();Lit.Next())
- mgrSelector->Activate(anIObj,Lit.Value(),myCollectorSel);
-
- break;
- }
- default:
- break;
+ mgrSelector->Activate(anIObj,Lit.Value(),myMainSel);
}
+ }
}
}
case AIS_DS_Temporary:
myMainVwr->Update();
break;
- case AIS_DS_Erased:
- myCollectorVwr->Update();
- break;
default:
break;
}
STATUS->AddDisplayMode(aMode);
if(STATUS->GraphicStatus()== AIS_DS_Displayed){
- myMainPM->Erase(anObj, myDisplayMode);
+ myMainPM->SetVisibility (anObj, myDisplayMode, Standard_False);
myMainPM->Display(anObj, aMode);
if(STATUS->IsSubIntensityOn())
myMainPM->Color(anObj,mySubIntensity,aMode);
if(!myObjects.IsBound(anIObj))
anIObj->SetDisplayMode(aMode);
-#ifdef BUC60632
else if( anIObj->AcceptDisplayMode(aMode) )
-#else
- else
-#endif
{
// CLE
// const Handle(AIS_GlobalStatus)& STATUS = myObjects(anIObj);
Handle(AIS_GlobalStatus) STATUS = myObjects(anIObj);
// ENDCLE
-#ifndef OCC4373
- // the interactive object has no mode : OldMode = Mode Session
- // already has a mode : OldMode = old mode Propre
-
- Standard_Integer OldMode = anIObj->HasDisplayMode() ? anIObj->DisplayMode(): myDisplayMode;
-
- if(STATUS->IsDModeIn(OldMode))
- STATUS->RemoveDisplayMode(OldMode);
- STATUS->AddDisplayMode(aMode);
-
- if(STATUS->GraphicStatus()==AIS_DS_Displayed){
- if(aMode!=OldMode ){
- if(myMainPM->IsHighlighted(anIObj,OldMode))
- myMainPM->Unhighlight(anIObj,OldMode);
-
- myMainPM->Erase(anIObj,OldMode);
-#else
// SAN : erase presentations for all display modes different from <aMode>
if(STATUS->GraphicStatus()==AIS_DS_Displayed){
TColStd_ListOfInteger aModesToRemove;
aModesToRemove.Append(OldMode);
if(myMainPM->IsHighlighted(anIObj,OldMode))
myMainPM->Unhighlight(anIObj,OldMode);
- myMainPM->Erase(anIObj,OldMode);
+ myMainPM->SetVisibility (anIObj, OldMode, Standard_False);
}
}
if(!STATUS->IsDModeIn(aMode))
STATUS->AddDisplayMode(aMode);
-#endif
-
+
myMainPM->Display(anIObj,aMode);
Standard_Integer DM,HM,SM;
GetDefModes(anIObj,DM,HM,SM);
myMainVwr->Viewer()->SetTransparency(Standard_True);
if(updateviewer) myMainVwr->Update();
-#ifndef OCC4373
- }
-#endif
}
anIObj->SetDisplayMode(aMode);
}
if(STATUS->GraphicStatus()==AIS_DS_Displayed){
if(myMainPM->IsHighlighted(anIObj,OldMode))
myMainPM->Unhighlight(anIObj,OldMode);
- myMainPM->Erase(anIObj,OldMode);
+ myMainPM->SetVisibility (anIObj, OldMode, Standard_False);
myMainPM->Display(anIObj,myDisplayMode);
Standard_Integer DM,HM,SM;
GetDefModes(anIObj,DM,HM,SM);
}
if( found && updateViewer) {
myMainVwr->Update();
- if( !(myIsCollClosed && myCollectorVwr.IsNull()) )
- myCollectorVwr->Update();
}
}
}
astatus +="\t| -->Erased\n";
break;
}
- case AIS_DS_FullErased:
- {
- astatus +="\t| -->Full Erased\n";
- break;
- }
default:
break;
}
//=======================================================================
void AIS_InteractiveContext::EraseGlobal(const Handle(AIS_InteractiveObject)& anIObj,
- const Standard_Boolean updateviewer,
- const Standard_Boolean PutInCollector)
+ const Standard_Boolean updateviewer)
{
if(anIObj.IsNull()) return ;
if(!myObjects.IsBound(anIObj)) return;
for(;ItL.More();ItL.Next()){
if(myMainPM->IsHighlighted(anIObj,ItL.Value()))
myMainPM->Unhighlight(anIObj,ItL.Value());
- myMainPM->Erase(anIObj,ItL.Value());
+ myMainPM->SetVisibility (anIObj, ItL.Value(), Standard_False);
}
if(IsCurrent(anIObj) && !STATUS->IsDModeIn(Dmode))
- myMainPM->Erase(anIObj,Dmode);
+ myMainPM->SetVisibility (anIObj, Dmode, Standard_False);
for(ItL.Initialize(STATUS->SelectionModes());ItL.More();ItL.Next())
mgrSelector->Deactivate(anIObj,ItL.Value(),myMainSel);
if(updateviewer) myMainVwr->Update();
}
- if(PutInCollector && !myCollectorPM.IsNull()){
- myCollectorPM->Display(anIObj,Dmode);
-#ifdef OCC328
- Standard_Integer SMode = anIObj->SelectionMode();
- mgrSelector->Activate(anIObj,SMode,myCollectorSel);
-#else
- mgrSelector->Activate(anIObj,0,myCollectorSel);
-#endif
- if(STATUS->IsHilighted())
- myCollectorPM->Highlight(anIObj,Dmode);
- STATUS->SetGraphicStatus(AIS_DS_Erased);
- if(updateviewer) myCollectorVwr->Update();
- }
- else
- STATUS->SetGraphicStatus(AIS_DS_FullErased);
+ STATUS->SetGraphicStatus(AIS_DS_Erased);
}
if(myLastinMain == anIObj)
myLastinMain.Nullify();
- if(myLastinColl == anIObj)
- myLastinColl.Nullify();
if(myLastPicked == anIObj)
myLastPicked.Nullify();
// to avoid memory leaks
mgrSelector->Remove(anIObj);
- switch(STATUS->GraphicStatus()){
- case AIS_DS_Erased:
- {
- Standard_Integer DM = anIObj->HasHilightMode() ? anIObj->HilightMode() : 0;
- if(STATUS->IsHilighted()){
- myCollectorPM->Unhighlight(anIObj,DM);
- }
- myCollectorPM->Erase(anIObj,DM);
- myCollectorPM->Clear(anIObj,DM);
- if(updateviewer) myCollectorVwr->Update();
- break;
- }
- case AIS_DS_Displayed:
- {
- if(updateviewer) myMainVwr->Update();
- break;
- }
- default:
- break;
- }
+ if (updateviewer && (STATUS->GraphicStatus() == AIS_DS_Displayed))
+ {
+ myMainVwr->Update();
+ }
+
myObjects.UnBind(anIObj);
}
myMainPM->Clear(anIObj,aMode);
}
- if(STATUS->GraphicStatus()== AIS_DS_Erased)
- {
- if(DM==aMode){
- if(STATUS->IsHilighted())
- myCollectorPM->Unhighlight(anIObj,aMode);
- myCollectorPM->Erase(anIObj,DM);
- myCollectorPM->Clear(anIObj,DM);
- }
- if(updateviewer) myCollectorVwr->Update();
- }
- else if(STATUS->GraphicStatus()==AIS_DS_Displayed && updateviewer)
+
+ if(STATUS->GraphicStatus()==AIS_DS_Displayed && updateviewer)
myMainVwr->Update();
}
myLocalContexts(myCurLocalIndex)->SetSensitivityMode(aMode);
else {
myMainSel->SetSensitivityMode(aMode);
- if( !myCollectorSel.IsNull() ) myCollectorSel->SetSensitivityMode(aMode);
}
}
myLocalContexts(myCurLocalIndex)->SetSensitivity(aPrecision);
else {
myMainSel->SetSensitivity(aPrecision);
- if( !myCollectorSel.IsNull() ) myCollectorSel->SetSensitivity(aPrecision);
}
}
myLocalContexts(myCurLocalIndex)->SetPixelTolerance(aPrecision);
else {
myMainSel->SetPixelTolerance(aPrecision);
- if( !myCollectorSel.IsNull() ) myCollectorSel->SetPixelTolerance(aPrecision);
}
}
if (myObjects.IsBound (theIObj))
{
- switch (myObjects (theIObj)->GraphicStatus ())
+ if (myObjects (theIObj)->GraphicStatus() == AIS_DS_Displayed || myObjects (theIObj)->GraphicStatus() == AIS_DS_Erased)
{
- case AIS_DS_Displayed:
- {
- theIObj->SetZLayer (myMainPM, theLayerId);
- break;
- }
- case AIS_DS_Erased:
- {
- theIObj->SetZLayer (myCollectorPM, theLayerId);
- break;
- }
- default:
- break;
+ theIObj->SetZLayer (myMainPM, theLayerId);
}
}
else if (HasOpenedContext ())
return myMainVwr;
}
-inline const Handle(V3d_Viewer)& AIS_InteractiveContext::Collector() const
-{
- return myCollectorVwr;
-}
-
inline Quantity_NameOfColor AIS_InteractiveContext::HilightColor() const
{
return myHilightColor;
inline Quantity_NameOfColor AIS_InteractiveContext::DefaultColor() const
{ return myDefaultColor;
}
-inline Standard_Boolean AIS_InteractiveContext::IsCollectorClosed() const
-{return myIsCollClosed;}
-
-inline void AIS_InteractiveContext::CloseCollector()
-{myIsCollClosed = Standard_True;}
-
inline Quantity_NameOfColor AIS_InteractiveContext::SubIntensityColor() const
{
inline const Handle(PrsMgr_PresentationManager3d)& AIS_InteractiveContext::MainPrsMgr() const
{return myMainPM ;}
-inline const Handle(PrsMgr_PresentationManager3d)& AIS_InteractiveContext::CollectorPrsMgr() const
-{return myCollectorPM ;}
-
-
inline Standard_Boolean AIS_InteractiveContext::HasOpenedContext() const
{return myCurLocalIndex != 0;}
inline const Handle(StdSelect_ViewerSelector3d)& AIS_InteractiveContext::MainSelector() const
{return myMainSel;}
-inline const Handle(StdSelect_ViewerSelector3d)& AIS_InteractiveContext::CollectorSelector() const
-{return myCollectorSel;}
-
inline void AIS_InteractiveContext::SetToHilightSelected(const Standard_Boolean toHilight)
{
myToHilightSelected = toHilight;
const Standard_Integer YPix,
const Handle(V3d_View)& aView)
{
- if(HasOpenedContext()&& aView->Viewer()!=myCollectorVwr){
+ if(HasOpenedContext()){
myWasLastMain = Standard_True;
return myLocalContexts(myCurLocalIndex)->MoveTo(XPix,YPix,aView);
}
myLastPicked = myLastinMain;
myWasLastMain = Standard_True;
}
- else if (aView->Viewer()== myCollectorVwr){
- pmgr = myCollectorPM;
- selector=myCollectorSel;
- myLastPicked = myLastinColl;
- ismain = Standard_False;
- myWasLastMain = Standard_False;
- }
else
return AIS_SOD_Error;
if ( ismain )
myLastinMain = myLastPicked;
- else
- myLastinColl = myLastPicked;
#ifdef IMP191001
// Highlight detected object if it is not selected or myToHilightSelected flag is true
if ( !myLastPicked.IsNull() &&
if ( ismain )
myLastinMain.Nullify();
- else
- myLastinColl.Nullify();
}
if(UpdVwr) aView->Viewer()->Update();
if(aView->Viewer()== myMainVwr) {
selector= myMainSel;
myWasLastMain = Standard_True;}
-
- else if (aView->Viewer()==myCollectorVwr){
- selector= myCollectorSel;
- myWasLastMain = Standard_False;}
-
-
+
selector->Pick(XPMin,YPMin,XPMax,YPMax,aView);
AIS_Selection::SetCurrentSelection(myCurrentName.ToCString());
if(aView->Viewer()== myMainVwr) {
selector= myMainSel;
myWasLastMain = Standard_True;}
-
- else if (aView->Viewer()==myCollectorVwr){
- selector= myCollectorSel;
- myWasLastMain = Standard_False;}
-
-
+
selector->Pick(aPolyline,aView);
AIS_Selection::SetCurrentSelection(myCurrentName.ToCString());
if(updateviewer)
UpdateCurrentViewer();}
}
- else if (!myWasLastMain && !myLastinColl.IsNull()){
- if(myLastinColl->State()!=1){
- SetCurrentObject(myLastinColl,Standard_False);
- if(updateviewer)
- UpdateCollector();}
- }
else{
AIS_Selection::SetCurrentSelection(myCurrentName.ToCString());
Handle(AIS_Selection) S = AIS_Selection::CurrentSelection();
AIS_Selection::Select();
if(updateviewer){
if(myWasLastMain)
- UpdateCurrentViewer();
- else
- UpdateCollector();
+ UpdateCurrentViewer();
}
}
Standard_Integer NS = NbCurrents();
}
if(myWasLastMain && !myLastinMain.IsNull())
AddOrRemoveCurrentObject(myLastinMain,updateviewer);
- else if (!myWasLastMain && !myLastinColl.IsNull())
- AddOrRemoveCurrentObject(myLastinColl,updateviewer);
-
-
+
Standard_Integer NS = NbCurrents();
if(NS==0) return AIS_SOP_NothingSelected;
if(NS==1) return AIS_SOP_OneSelected;
if(aView->Viewer()== myMainVwr) {
selector= myMainSel;
myWasLastMain = Standard_True;}
-
- else if (aView->Viewer()==myCollectorVwr){
- selector= myCollectorSel;
- myWasLastMain = Standard_False;}
else
return AIS_SOP_NothingSelected;
selector= myMainSel;
myWasLastMain = Standard_True;
}
- else if ( aView->Viewer() == myCollectorVwr ) {
- selector= myCollectorSel;
- myWasLastMain = Standard_False;
- }
else
return AIS_SOP_NothingSelected;
// entities connected to dynamic selection at neutral point are set to 0.
myLastinMain.Nullify();
- myLastinColl.Nullify();
myLastPicked.Nullify();
myWasLastMain = Standard_True;
ResetOriginalState(Standard_False);
myMainSel->UpdateSort();
- if(!myIsCollClosed && !myCollectorSel.IsNull())
- myCollectorSel->UpdateSort();
if(updateviewer) myMainVwr->Update();
}
if(GB->IsSubIntensityOn())
return;
GB->SubIntensityOn();
- Standard_Boolean UpdMain(Standard_False),UpdColl(Standard_False);
+ Standard_Boolean UpdMain(Standard_False);
for(TColStd_ListIteratorOfListOfInteger It(GB->DisplayedModes());It.More();It.Next()){
- if(GB->GraphicStatus()==AIS_DS_Displayed){
+ if (GB->GraphicStatus()==AIS_DS_Displayed)
+ {
myMainPM->Color(anIObj,mySubIntensity,It.Value());
- UpdMain = Standard_True;}
- else if(GB->GraphicStatus()==AIS_DS_Erased){
- myCollectorPM->Color(anIObj,mySubIntensity,It.Value());
- UpdColl=Standard_True;
+ UpdMain = Standard_True;
}
}
if(updateviewer){
if(UpdMain)
myMainVwr->Update();
- if(UpdColl)
- myCollectorVwr->Update();
}
}
else {
if(!GB->IsSubIntensityOn())
return;
GB->SubIntensityOff();
- Standard_Boolean UpdMain(Standard_False),UpdColl(Standard_False);
+ Standard_Boolean UpdMain(Standard_False);
for(TColStd_ListIteratorOfListOfInteger It(GB->DisplayedModes());It.More();It.Next()){
- if(GB->GraphicStatus()!=AIS_DS_Erased){
+ if(GB->GraphicStatus()==AIS_DS_Displayed)
+ {
myMainPM->Unhighlight(anIObj,It.Value());
- UpdMain = Standard_True;}
- else {
- myCollectorPM->Unhighlight(anIObj,It.Value());
- UpdColl=Standard_True;
+ UpdMain = Standard_True;
}
}
if(updateviewer){
if(UpdMain)
myMainVwr->Update();
- if(UpdColl)
- myCollectorVwr->Update();
}
}
else {
//purpose :
//=======================================================================
-Standard_Integer AIS_InteractiveContext::PurgeDisplay(const Standard_Boolean CollectorToo)
+Standard_Integer AIS_InteractiveContext::PurgeDisplay()
{
if(HasOpenedContext()) return 0;
Standard_Integer NbStr = PurgeViewer(myMainVwr);
- if(!myCollectorVwr.IsNull())
- if(CollectorToo){
- NbStr+=PurgeViewer(myCollectorVwr);
- if(!IsCollectorClosed())
- myCollectorVwr->Update();
- }
myMainVwr->Update();
return NbStr;
void AIS_InteractiveContext::ResetOriginalState(const Standard_Boolean updateviewer)
{
- Standard_Boolean upd_main(Standard_False),upd_col(Standard_False);
+ Standard_Boolean upd_main(Standard_False);
TColStd_ListIteratorOfListOfInteger itl;
for (AIS_DataMapIteratorOfDataMapOfIOStatus it(myObjects);it.More();it.Next()){
break;
}
case AIS_DS_Erased:{
- upd_col = Standard_True;
- EraseGlobal(iobj,Standard_False,Standard_True);
- break;
- }
- case AIS_DS_FullErased:{
- EraseGlobal(iobj,Standard_False,Standard_False);
+ EraseGlobal(iobj,Standard_False);
break;
}
default:
if(updateviewer){
if(upd_main)
myMainVwr->Update();
- if(upd_col)
- myCollectorVwr->Update();
}
}
#include <AIS_GlobalStatus.hxx>
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
-//=======================================================================
-//function : Erase
-//purpose : display an interactive object from the collector.
-//=======================================================================
-void AIS_InteractiveContext::DisplayFromCollector(const Handle(AIS_InteractiveObject)& anIObj,
- const Standard_Boolean updateviewer)
-{
- if ( !IsInCollector( anIObj ) ) return;
-
- if ( !HasOpenedContext() ){
-
- if ( DisplayStatus( anIObj ) == AIS_DS_Erased )
- Display( anIObj,Standard_False);
-
- if( updateviewer ){
- myMainVwr->Update();
- if( !myCollectorVwr.IsNull() )
- myCollectorVwr->Update();
- }
- }
-}
-
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
//=======================================================================
AddOrRemoveSelected(anInteractive);
if(myMainPM->IsHighlighted(anInteractive,STAT->HilightMode()))
myMainPM->Unhighlight(anInteractive,STAT->HilightMode());
- myMainPM->Erase(anInteractive,STAT->DisplayMode());
+ myMainPM->SetVisibility (anInteractive, STAT->DisplayMode(), Standard_False);
STAT->SetDisplayMode(-1);
status = Standard_True;
}
if(STAT->IsTemporary()){
if(myMainPM->IsDisplayed(anInteractive,STAT->HilightMode()))
- myMainPM->Erase(anInteractive,STAT->HilightMode());
+ myMainPM->SetVisibility (anInteractive, STAT->HilightMode(), Standard_False);
}
//selection step
AIS_DataMapIteratorOfDataMapOfSelStat ItM(myActiveObjects);
for(;ItM.More();ItM.Next()){
-#ifdef BUC60722
- AIS_DisplayStatus DS =
- myCTX->DisplayStatus(Handle(AIS_InteractiveObject)::DownCast(ItM.Key()));
- if( ItM.Value()->Decomposed() && (DS != AIS_DS_FullErased) )
-#else
if(ItM.Value()->Decomposed())
-#endif
myCTX->SelectionManager()->Activate(ItM.Key(),
IMode,
myMainVS);
myMainPM->Unhighlight(anObject,Att->HilightMode());
if(Att->IsTemporary() && Att->DisplayMode()==-1)
if(!IsSomeWhereElse)
- myMainPM->Erase(anObject,Att->HilightMode());
-
+ myMainPM->SetVisibility (anObject, Att->HilightMode(), Standard_False);
+
Att->SubIntensityOff();
Att->SetHilightColor(Quantity_NOC_WHITE);
}
void AIS_LocalContext::ClearDetected()
{
- for(Standard_Integer I=1;I<=myMapOfOwner.Extent();I++){
-
- if(!myMapOfOwner(I).IsNull()){
+ for(Standard_Integer I=1;I<=myMapOfOwner.Extent();I++)
+ {
+ if(!myMapOfOwner(I).IsNull())
+ {
if(myMapOfOwner(I)->IsHilighted(myMainPM))
- myMapOfOwner(I)->Unhilight(myMainPM);
- else if (myMapOfOwner(I)->IsHilighted(myCTX->CollectorPrsMgr()))
- myMapOfOwner(I)->Unhilight(myCTX->CollectorPrsMgr());
-
- else{
- const Handle(SelectMgr_SelectableObject)& SO =
- myMapOfOwner.FindKey(I)->Selectable();
- if(myActiveObjects.IsBound(SO)){
- const Handle(AIS_LocalStatus)& Att = myActiveObjects(SO);
-
- if(Att->IsTemporary() &&
- Att->DisplayMode()==-1 &&
- Att->SelectionModes().IsEmpty()){
- myMapOfOwner(I)->Clear(myMainPM);
- //myMapOfOwner(I)->Clear();//rob-jmi...
- }
- }
+ myMapOfOwner(I)->Unhilight(myMainPM);
+ else
+ {
+ const Handle(SelectMgr_SelectableObject)& SO =
+ myMapOfOwner.FindKey(I)->Selectable();
+ if(myActiveObjects.IsBound(SO))
+ {
+ const Handle(AIS_LocalStatus)& Att = myActiveObjects(SO);
+
+ if(Att->IsTemporary() &&
+ Att->DisplayMode()==-1 &&
+ Att->SelectionModes().IsEmpty())
+ {
+ myMapOfOwner(I)->Clear(myMainPM);
+ }
+ }
}
}
}
-
}
void AIS_LocalContext::UpdateConversion()
//=======================================================================
void AIS_LocalContext::HilightPicked(const Standard_Boolean updateviewer)
{
- Standard_Boolean updMain(Standard_False),updColl(Standard_False);
+ Standard_Boolean updMain(Standard_False);
Handle(AIS_Selection) Sel = AIS_Selection::Selection(mySelName.ToCString());
#ifdef BUC60765
if(BROwnr.IsNull() || !BROwnr->ComesFromDecomposition()){
Handle(SelectMgr_SelectableObject) SO = Ownr->Selectable();
IO = *((Handle(AIS_InteractiveObject)*)&SO);
- if(myCTX->IsInCollector(IO)){
- PM = myCTX->CollectorPrsMgr();
- updColl = Standard_True;}
- else
- updMain = Standard_True;
+ updMain = Standard_True;
}
else
updMain = Standard_True;
#else
if(updMain) myCTX->CurrentViewer()->Update();
#endif
- if(updColl) myCTX->Collector()->Update();
}
}
void AIS_LocalContext::
UnhilightPicked(const Standard_Boolean updateviewer)
{
- Standard_Boolean updMain(Standard_False),updColl(Standard_False);
+ Standard_Boolean updMain(Standard_False);
Handle(AIS_Selection) Sel = AIS_Selection::Selection(mySelName.ToCString());
#ifdef BUC60765
Handle(AIS_InteractiveObject) IO = *((Handle(AIS_InteractiveObject)*)&SO);
HM = GetHiMod(IO);
#endif
- if(myCTX->IsInCollector(IO)){
- PM = myCTX->CollectorPrsMgr();
- updColl = Standard_True;}
- else
- updMain = Standard_True;
+ updMain = Standard_True;
}
else
updMain = Standard_True;
#else
if(updMain) myCTX->CurrentViewer()->Update();
#endif
- if(updColl) myCTX->Collector()->Update();
}
}
is deferred;
---Purpose: call_togl_markercontextgroup
- MarkerContextGroup ( me : mutable;
- ACGroup : CGroup from Graphic3d;
- NoInsert : Integer from Standard;
- AMarkWidth : Integer from Standard;
- AMarkHeight: Integer from Standard;
- ATexture : HArray1OfByte from TColStd )
- is deferred;
- ---Purpose: call_togl_markercontextgroup
-
RemoveGroup ( me : mutable;
ACGroup : CGroup from Graphic3d )
is deferred;
---Purpose: returns Handle to display connection
+ IsDeviceLost (me)
+ returns Boolean from Standard;
+ -- Purpose: @return Standard_True in cases when the last view has been removed but some objects still present.
+
+ ResetDeviceLostFlag (me: mutable);
+ -- Purpose: Resets DeviceLostFlag to default (Standard_False) state.
+
fields
MyTraceLevel : Integer from Standard is protected;
MySharedLibrary : SharedLibrary from OSD is protected;
myDisplayConnection: DisplayConnection_Handle from Aspect is protected;
+ myDeviceLostFlag : Boolean from Standard is protected;
end GraphicDriver from Graphic3d;
SetTrace (0);
MySharedLibrary.SetName (AShrName);
+ myDeviceLostFlag = Standard_False;
//if (! MySharedLibrary.DlOpen (OSD_RTLD_LAZY))
//Aspect_DriverDefinitionError::Raise (MySharedLibrary.DlError ());
{
return myDisplayConnection;
}
+
+Standard_Boolean Graphic3d_GraphicDriver::IsDeviceLost() const
+{
+ return myDeviceLostFlag;
+}
+
+void Graphic3d_GraphicDriver::ResetDeviceLostFlag()
+{
+ myDeviceLostFlag = Standard_False;
+}
-- Category: Compute methods
----------------------------
+ Compute (me: mutable)
+ is virtual;
+ ---Level: Advanced
+ ---Category: Methods to modify the class definition
+
Compute ( me : mutable;
aProjector : DataStructureManager from Graphic3d )
returns Structure from Graphic3d is virtual;
MyStructureManager->Display (this);
}
+ MyCStructure.visible = 1;
}
void Graphic3d_Structure::Display (const Standard_Integer Priority) {
MyStructureManager->Display (this);
}
+ MyCStructure.visible = 1;
}
void Graphic3d_Structure::SetDisplayPriority (const Standard_Integer Priority) {
MyGraphicDriver->NameSetStructure (MyCStructure);
- if (AValue)
- MyStructureManager->Visible (this);
- else
- MyStructureManager->Invisible (this);
-
Update ();
}
}
+void Graphic3d_Structure::Compute()
+{
+ // Implemented by Presentation
+}
+
Handle(Graphic3d_Structure) Graphic3d_Structure::Compute (const Handle(Graphic3d_DataStructureManager)& ) {
// Implemented by Presentation
if (MyCStructure.highlight) {
}
- if (MyCStructure.visible) {
- MyStructureManager->Invisible (this);
- AManager->Visible (this);
- }
-
if (MyCStructure.pick) {
MyStructureManager->Undetectable (this);
AManager->Detectable (this);
-- in a visualiser <me>.
---Category: Inquire methods, MapOfStructure
- VisibleStructures ( me; SG: in out MapOfStructure from Graphic3d )
- is static;
- ---Level: Internal
- ---Purpose: Returns the set of visible structures
- -- in a visualiser <me>.
- ---Category: Inquire methods, MapOfStructure
-
----------------------------
-- Category: Inquire methods
----------------------------
---Category: Private methods
---C++: return const &
- Invisible ( me : mutable;
- AStructure : Structure from Graphic3d )
- is static private;
- ---Level: Internal
- ---Purpose: Sets invisible the structure <AStructure>.
- ---Category: Private methods
-
Identification ( me )
returns Integer from Standard
is virtual;
---Purpose: Suppress the highlighting on the structure <AStructure>.
---Category: Private methods
- Visible ( me : mutable;
- AStructure : Structure from Graphic3d )
- is static private;
- ---Level: Internal
- ---Purpose: Sets visible the structure <AStructure>.
- -- in the manager.
- ---Category: Private methods
+ ReComputeStructures (me: mutable);
+ -- Purpose: Recomputes all displayed structures. Used to recompute GL
+ -- resources after the last view has been closed without removing objects.
+
--\f
fields
MyHighlightedStructure : MapOfStructure from Graphic3d
is protected;
- -- the visible structures
- MyVisibleStructure : MapOfStructure from Graphic3d
- is protected;
-
-- the pickable structures
MyPickStructure : MapOfStructure from Graphic3d
is protected;
// -- les structures mises en evidence
// MyHighlightedStructure : SequenceOfStructure;
-// -- les structures visibles
-// MyVisibleStructure : SequenceOfStructure;
-
// -- les structures detectables
// MyPickStructure : SequenceOfStructure;
Graphic3d_StructureManager::Graphic3d_StructureManager (const Handle(Graphic3d_GraphicDriver)& theDriver):
MyDisplayedStructure (),
MyHighlightedStructure (),
-MyVisibleStructure (),
MyPickStructure () {
Standard_Real Coef;
MyDisplayedStructure.Clear ();
MyHighlightedStructure.Clear ();
- MyVisibleStructure.Clear ();
MyPickStructure.Clear ();
StructureManager_ArrayId[MyId] = 0;
}
-void Graphic3d_StructureManager::Visible (const Handle(Graphic3d_Structure)& AStructure) {
-
- MyVisibleStructure.Add(AStructure);
-
-}
-
-void Graphic3d_StructureManager::Invisible (const Handle(Graphic3d_Structure)& AStructure) {
-
- MyVisibleStructure.Remove(AStructure);
-
-}
-
void Graphic3d_StructureManager::Detectable (const Handle(Graphic3d_Structure)& AStructure) {
MyPickStructure.Add(AStructure);
}
-void Graphic3d_StructureManager::VisibleStructures (Graphic3d_MapOfStructure& SG) const {
-
- SG.Assign(MyVisibleStructure);
-
-
-}
-
void Graphic3d_StructureManager::MinMaxValues (Standard_Real& XMin, Standard_Real& YMin, Standard_Real& ZMin, Standard_Real& XMax, Standard_Real& YMax, Standard_Real& ZMax) const {
Standard_Boolean Flag = Standard_True;
return (MyGraphicDriver);
}
+
+void Graphic3d_StructureManager::ReComputeStructures()
+{
+ for (Graphic3d_MapIteratorOfMapOfStructure anIter(MyDisplayedStructure); anIter.More(); anIter.Next())
+ {
+ Handle(Graphic3d_Structure) aStructure = anIter.Key();
+
+ aStructure->Clear();
+ aStructure->Compute();
+ }
+}
const Standard_Integer theNoInsert);
Standard_EXPORT void MarkerContextGroup (const Graphic3d_CGroup& theCGroup,
const Standard_Integer theNoInsert);
- Standard_EXPORT void MarkerContextGroup (const Graphic3d_CGroup& theCGroup,
- const Standard_Integer theNoInsert,
- const Standard_Integer theMarkWidth,
- const Standard_Integer theMarkHeight,
- const Handle(TColStd_HArray1OfByte)& theTexture);
Standard_EXPORT void RemoveGroup (const Graphic3d_CGroup& theCGroup);
Standard_EXPORT void TextContextGroup (const Graphic3d_CGroup& theCGroup,
const Standard_Integer theNoInsert);
((OpenGl_Group* )theCGroup.ptrGroup)->SetAspectMarker (GetSharedContext(), theCGroup.ContextMarker, theNoInsert);
}
-void OpenGl_GraphicDriver::MarkerContextGroup (const Graphic3d_CGroup& theCGroup,
- const Standard_Integer theNoInsert,
- const Standard_Integer /*theMarkWidth*/,
- const Standard_Integer /*theMarkHeight*/,
- const Handle(TColStd_HArray1OfByte)& /*theTexture*/)
-{
- if (!theCGroup.ContextMarker.IsDef)
- {
- return;
- }
-
- if (theCGroup.ptrGroup != NULL)
- {
- ((OpenGl_Group* )theCGroup.ptrGroup)->SetAspectMarker (GetSharedContext(), theCGroup.ContextMarker, theNoInsert);
- }
-}
-
void OpenGl_GraphicDriver::RemoveGroup (const Graphic3d_CGroup& theCGroup)
{
OpenGl_Structure* aStructure = (OpenGl_Structure* )theCGroup.Struct->ptrStructure;
#include <OpenGl_Structure.hxx>
#include <OpenGl_CView.hxx>
#include <OpenGl_Display.hxx>
+#include <OpenGl_Text.hxx>
/*----------------------------------------------------------------------*/
OpenGl_Structure* aStruct = aStructIt.ChangeValue();
aStruct->ReleaseGlResources (aShareCtx);
}
+ myTempText->Release (aShareCtx);
+ myDeviceLostFlag = Standard_True;
}
OpenGl_CView* aCView = (OpenGl_CView* )theCView.ptrView;
myTransformPersistence : CTransPersStruct from Graphic3d;
friends
+ class Presentation3d from PrsMgr,
class PresentationManager from PrsMgr,
Compute from Presentation3d from PrsMgr(me : mutable; aProjector : DataStructureManager from Graphic3d),
Compute from Presentation3d from PrsMgr(me : mutable; aProjector : DataStructureManager from Graphic3d;
Display(me: mutable) is deferred private;
Erase(me) is deferred private;
-
+
+ SetVisible (me: mutable; theValue: Boolean from Standard) is deferred private;
+
Highlight(me: mutable) is deferred private;
Unhighlight (me) is deferred private;
Display(me: mutable)
is redefined static private;
- Erase(me) is redefined static private;
+ Display (me: mutable;
+ theIsHighlight: Boolean from Standard)
+ is static private;
+ ---Level: Private;
+ ---Purpose: displays myStructure and sets myDisplayReason to theIsHighlight value if
+ -- myStructure was not displayed or was invisible
+ Erase(me) is redefined static private;
+
+ SetVisible (me: mutable; theValue: Boolean from Standard) is redefined static private;
+
Highlight(me: mutable) is redefined static private;
Unhighlight (me) is redefined static private;
---Category: Computed Structures
+ Compute(me : mutable; theStructure: Structure from Graphic3d)
+ is static private;
+
Compute(me : mutable; aProjector: DataStructureManager from Graphic3d)
returns Structure from Graphic3d
is static private;
#include <PrsMgr_Presentation3d.ixx>
#include <PrsMgr_PresentationManager.hxx>
#include <PrsMgr_Prs.hxx>
+#include <PrsMgr_ModedPresentation.hxx>
#include <Visual3d_View.hxx>
#include <Visual3d_ViewOrientation.hxx>
#include <Graphic3d_Structure.hxx>
{return PrsMgr_KOP_3D;}
-void PrsMgr_Presentation3d::Display () {
- myStructure->Display();
+void PrsMgr_Presentation3d::Display()
+{
+ Display (Standard_False);
myDisplayReason = Standard_False;
}
+void PrsMgr_Presentation3d::Display(const Standard_Boolean theIsHighlight)
+{
+ if (!myStructure->IsDisplayed())
+ {
+ myStructure->Display();
+ myDisplayReason = theIsHighlight;
+ }
+ else if (!myStructure->IsVisible())
+ {
+ myStructure->SetVisible (Standard_True);
+ myDisplayReason = theIsHighlight;
+ }
+}
+
void PrsMgr_Presentation3d::Erase () const {
myStructure->Erase();}
+void PrsMgr_Presentation3d::SetVisible (const Standard_Boolean theValue)
+{
+ myStructure->SetVisible (theValue);
+}
+
void PrsMgr_Presentation3d::Highlight () {
- if(!myStructure->IsDisplayed()) {
- myStructure->Display();
- myDisplayReason = Standard_True;
- }
+ Display (Standard_True);
myStructure->Highlight();}
void PrsMgr_Presentation3d::Unhighlight () const {
myStructure->UnHighlight();
- if(myDisplayReason) myStructure->Erase();
+ if (myDisplayReason) myStructure->SetVisible (Standard_False);
}
void PrsMgr_Presentation3d::Clear() {
}
void PrsMgr_Presentation3d::Color(const Quantity_NameOfColor aColor){
- Standard_Boolean ImmMode = myPresentationManager->IsImmediateModeOn();
- if(!ImmMode){
- if(!myStructure->IsDisplayed()) {
- myStructure->Display();
- myDisplayReason = Standard_True;
- }
- }
+ Display (Standard_True);
myStructure->Color(aColor);
}
}
Standard_Boolean PrsMgr_Presentation3d::IsDisplayed () const {
- return myStructure->IsDisplayed() && !myDisplayReason;
+ return myStructure->IsDisplayed() && myStructure->IsVisible() && !myDisplayReason;
}
Standard_Boolean PrsMgr_Presentation3d::IsHighlighted () const {
//purpose :
//=======================================================================
+void PrsMgr_Presentation3d::Compute (const Handle(Graphic3d_Structure)& theStructure)
+{
+ Standard_Integer aDispMode = 0;
+
+ Standard_Integer aPresentationsNumber = myPresentableObject->myPresentations.Length();
+ for (Standard_Integer anIter = 1; anIter <= aPresentationsNumber; anIter++)
+ {
+ const PrsMgr_ModedPresentation& aModedPresentation = myPresentableObject->myPresentations.Value (anIter);
+ Handle(PrsMgr_Presentation) aPresentation = aModedPresentation.Presentation();
+ PrsMgr_Presentation3d* aPresentation3d = (PrsMgr_Presentation3d* )aPresentation.operator->();
+ if (aPresentation3d == this)
+ {
+ aDispMode = aModedPresentation.Mode();
+ break;
+ }
+ }
+
+ Handle(Prs3d_Presentation) aPrs3d = Handle(Prs3d_Presentation)::DownCast (theStructure);
+
+ myPresentableObject->Compute(
+ Handle(PrsMgr_PresentationManager3d)::DownCast (PresentationManager()),
+ aPrs3d,
+ aDispMode);
+}
+
+//=======================================================================
+//function : Compute
+//purpose :
+//=======================================================================
+
void PrsMgr_Presentation3d::Compute(const Handle(Graphic3d_DataStructureManager)& aProjector,
const Handle(Graphic3d_Structure)& TheStructToFill)
{
-- aPresentableObject in this framework with the
-- display mode aMode.
+ SetVisibility (me: mutable; thePresentableObject: PresentableObject from PrsMgr;
+ theMode: Integer from Standard;
+ theValue: Boolean from Standard);
+ ---Purpose: Sets the visibility of presentable object.
+
Highlight(me: mutable; aPresentableObject: mutable PresentableObject from PrsMgr;
aMode: Integer from Standard = 0)
---Purpose: Highlights the presentation of the presentable object
Presentation(aPresentableObject,aMode)->Clear();}
}
+void PrsMgr_PresentationManager::SetVisibility (const Handle(PrsMgr_PresentableObject)& thePresentableObject,
+ const Standard_Integer theMode,
+ const Standard_Boolean theValue)
+{
+ Presentation(thePresentableObject, theMode)->SetVisible (theValue);
+}
void PrsMgr_PresentationManager::Highlight(
const Handle(PrsMgr_PresentableObject)& aPresentableObject,
aPresentation : Presentation3dPointer from PrsMgr;
aTypeOfPresentation3d : TypeOfPresentation3d from PrsMgr)
returns mutable Prs from PrsMgr;
-
+
+ Compute (me: mutable)
+ is redefined static;
+
Compute(me : mutable; aProjector: DataStructureManager from Graphic3d)
returns Structure from Graphic3d
is redefined static;
//purpose :
//=======================================================================
+void PrsMgr_Prs::Compute()
+{
+ myPresentation3d->Compute (this);
+}
+
+//=======================================================================
+//function : Compute
+//purpose :
+//=======================================================================
+
Handle(Graphic3d_Structure) PrsMgr_Prs::Compute(const Handle(Graphic3d_DataStructureManager)& aProjector) {
return myPresentation3d->Compute(aProjector);
}
return 1;
}
- Standard_Boolean updateviewer = Standard_True, PutInCollector = Standard_True;
+ Standard_Boolean updateviewer = Standard_True;
ViewerTest_DoubleMapOfInteractiveAndName& aMap = GetMapOfAIS();
aContext->ActivateStandardMode(AIS_Shape::SelectionType(ChoosingMode));
theactivatedmodes.Add(ChoosingMode);
}
- aContext->Erase(AISObj, updateviewer, PutInCollector);
+ aContext->Erase(AISObj, updateviewer);
aContext->UpdateCurrentViewer();
aContext->Display(AISObj, updateviewer);
return 1;
}
- Standard_Boolean updateviewer = Standard_True, PutInCollector = Standard_True;
+ Standard_Boolean updateviewer = Standard_True;
ViewerTest_DoubleMapOfInteractiveAndName& aMap = GetMapOfAIS();
if (!aContext->HasOpenedContext()) {
aContext->OpenLocalContext();
}
- aContext->Erase(AISObj, updateviewer, PutInCollector);
+ aContext->Erase(AISObj, updateviewer);
aContext->UpdateCurrentViewer();
aContext->Display(AISObj, updateviewer);
aContext->UpdateCurrentViewer();
return 1;
}
- Standard_Boolean updateviewer = Standard_True, PutInCollector = Standard_True;
+ Standard_Boolean updateviewer = Standard_True;
ViewerTest_DoubleMapOfInteractiveAndName& aMap = GetMapOfAIS();
if (!aContext->HasOpenedContext()) {
aContext->OpenLocalContext();
}
- aContext->Erase(AISObj, updateviewer, PutInCollector);
+ aContext->Erase(AISObj, updateviewer);
aContext->UpdateCurrentViewer();
aContext->Display(AISObj, updateviewer);
aContext->UpdateCurrentViewer();
}
}
- // ObjectsInCollector
- AIS_ListOfInteractive ListOfIO_2;
- AISContext->ObjectsInCollector(ListOfIO_2);
- di<< "ObjectsInCollector = " << ListOfIO_2.Extent() <<"\n";
- if (!ListOfIO_2.IsEmpty() ) {
- AIS_ListIteratorOfListOfInteractive iter;
- for (iter.Initialize(ListOfIO_2); iter.More() ; iter.Next() ) {
- Handle(AIS_InteractiveObject) aIO=iter.Value();
- di<< GetMapOfAIS().Find1(aIO).ToCString() <<"\n";
- }
- }
-
return 0;
}
{
aisContext->CloseAllContexts();
aisContext->RemoveAll(false);
- aisContext->EraseSelected(false, false);
+ aisContext->EraseSelected(false);
}
- aisContext->EraseAll(false,false);
+ aisContext->EraseAll(false);
Handle(Geom_Axis2Placement) trihedronAxis = new Geom_Axis2Placement(gp::XOY());
Handle(AIS_Trihedron) trihedron = new AIS_Trihedron(trihedronAxis);
if (aMode)
Ctx->Display(IO,Mode,Upd);
break;
case 2:{
- Ctx->Erase(IO,Mode,Upd);
+ Ctx->Erase(IO,Upd);
break;
}
case 3:{
#include <Prs3d_PointAspect.hxx>
#include <Image_AlienPixMap.hxx>
+#include <TColStd_HArray1OfAsciiString.hxx>
#ifdef HAVE_STRINGS_H
#include <strings.h>
Standard_Real aHeight;
Standard_Boolean aZoomable;
Quantity_Color aColor;
- Standard_CString aFont;
+ TCollection_AsciiString aFont;
Font_FontAspect aFontAspect;
Graphic3d_HorizontalTextAlignment aHJustification;
Graphic3d_VerticalTextAlignment aVJustification;
Handle_Prs3d_TextAspect asp = myDrawer->TextAspect();
- asp->SetFont(aFont);
+ asp->SetFont(aFont.ToCString());
asp->SetColor(aColor);
asp->SetHeight(aHeight); // I am changing the myHeight value
public:
- MyPArrayObject (const Handle(Graphic3d_ArrayOfPrimitives) theArray,
+ MyPArrayObject (Handle(TColStd_HArray1OfAsciiString) theArrayDescription,
Handle(Graphic3d_AspectMarker3d) theMarkerAspect = NULL)
{
- myArray = theArray;
+ myArrayDescription = theArrayDescription;
myMarkerAspect = theMarkerAspect;
}
void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
const Standard_Integer /*theMode*/);
+ bool CheckInputCommand (const TCollection_AsciiString theCommand,
+ const Handle(TColStd_HArray1OfAsciiString) theArgsArray,
+ Standard_Integer &theArgIndex,
+ Standard_Integer theArgCount,
+ Standard_Integer theMaxArgs);
+
protected:
- Handle(Graphic3d_ArrayOfPrimitives) myArray;
+ Handle(TColStd_HArray1OfAsciiString) myArrayDescription;
Handle(Graphic3d_AspectMarker3d) myMarkerAspect;
};
const Handle(Prs3d_Presentation)& aPresentation,
const Standard_Integer /*aMode*/)
{
- aPresentation->Clear();
- if (!myMarkerAspect.IsNull())
- {
- Prs3d_Root::CurrentGroup (aPresentation)->SetGroupPrimitivesAspect (myMarkerAspect);
- }
- Prs3d_Root::CurrentGroup (aPresentation)->AddPrimitiveArray (myArray);
-}
-
-void MyPArrayObject::ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
- const Standard_Integer /*theMode*/)
-{
- Handle(SelectMgr_EntityOwner) anEntityOwner = new SelectMgr_EntityOwner (this);
-
- for (Standard_Integer anIter = 1; anIter <= myArray->VertexNumber(); anIter++)
- {
-
- Handle(Select3D_SensitivePoint) aSensetivePoint = new Select3D_SensitivePoint (anEntityOwner, myArray->Vertice (anIter));
- theSelection->Add (aSensetivePoint);
- }
-}
-
-static bool CheckInputCommand (const TCollection_AsciiString theCommand,
- const char **theArgStr, int &theArgIndex,
- int theArgCount, int theMaxArgs)
-{
- // check if there is more elements than expected
- if (theArgIndex >= theMaxArgs)
- return false;
-
- TCollection_AsciiString aStrCommand(theArgStr[theArgIndex]);
- aStrCommand.LowerCase();
- if (aStrCommand.Search(theCommand) != 1 ||
- theArgIndex + (theArgCount - 1) >= theMaxArgs)
- return false;
-
- // go to the first data element
- theArgIndex++;
-
- // check data if it can be converted to numeric
- for (int aElement = 0; aElement < theArgCount; aElement++, theArgIndex++)
- {
- aStrCommand = theArgStr[theArgIndex];
- if (!aStrCommand.IsRealValue())
- return false;
- }
-
- return true;
-}
-
-//=============================================================================
-//function : VDrawPArray
-//purpose : Draws primitives array from list of vertexes, bounds, edges
-//=============================================================================
-
-static int VDrawPArray (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
-{
- Handle(AIS_InteractiveContext) aContextAIS = ViewerTest::GetAISContext();
- if (aContextAIS.IsNull())
- {
- di << "Call vinit before!\n";
- return 1;
- }
- else if (argc < 3)
- {
- di << "Use: " << argv[0] << " Name TypeOfArray"
- << " [vertex] ... [bounds] ... [edges]\n"
- << " TypeOfArray={ points | segments | polylines | triangles |\n"
- << " trianglefans | trianglestrips | quads |\n"
- << " quadstrips | polygons }\n"
- << " vertex={ 'v' x y z [normal={ 'n' nx ny nz }] [color={ 'c' r g b }]"
- << " [texel={ 't' tx ty }] } \n"
- << " bounds={ 'b' verticies_count [color={ 'c' r g b }] }\n"
- << " edges={ 'e' vertex_id [hidden_edge={'h'}] }\n";
- return 1;
- }
- // read the arguments
- Standard_Integer aArgIndex = 1;
- TCollection_AsciiString aName (argv[aArgIndex++]);
- TCollection_AsciiString anArrayType (argv[aArgIndex++]);
- const Standard_Integer anArgsFrom = aArgIndex;
-
- // parse number of verticies, bounds, edges
+ // Parsing array description
Standard_Integer aVertexNum = 0, aBoundNum = 0, aEdgeNum = 0;
Standard_Boolean hasVColors, hasBColors, hasNormals, hasInfos, hasTexels;
hasVColors = hasNormals = hasBColors = hasInfos = hasTexels = Standard_False;
+ Standard_Integer anArgIndex = 0;
+ Standard_Integer anArgsCount = myArrayDescription->Length();
+ TCollection_AsciiString anArrayType = myArrayDescription->Value (anArgIndex++);
+
TCollection_AsciiString aCommand;
- while (aArgIndex < argc)
+ while (anArgIndex < anArgsCount)
{
- aCommand = argv[aArgIndex];
+ aCommand = myArrayDescription->Value (anArgIndex);
aCommand.LowerCase();
- if (!aCommand.IsAscii())
- {
- di << "Unexpected argument: #" << aArgIndex - 1 << " , "
- << "should be an array element: 'v', 'b', 'e' \n";
- break;
- }
// vertex command
- if (CheckInputCommand ("v", argv, aArgIndex, 3, argc))
+ if (CheckInputCommand ("v", myArrayDescription, anArgIndex, 3, anArgsCount))
{
// vertex has a normal or normal with color or texel
- if (CheckInputCommand ("n", argv, aArgIndex, 3, argc))
+ if (CheckInputCommand ("n", myArrayDescription, anArgIndex, 3, anArgsCount))
hasNormals = Standard_True;
// vertex has a color
- if (CheckInputCommand ("c", argv, aArgIndex, 3, argc))
+ if (CheckInputCommand ("c", myArrayDescription, anArgIndex, 3, anArgsCount))
hasVColors = Standard_True;
// vertex has a texel
- if (CheckInputCommand ("t", argv, aArgIndex, 2, argc))
+ if (CheckInputCommand ("t", myArrayDescription, anArgIndex, 2, anArgsCount))
hasTexels = Standard_True;
aVertexNum++;
}
// bound command
- else if (CheckInputCommand ("b", argv, aArgIndex, 1, argc))
+ else if (CheckInputCommand ("b", myArrayDescription, anArgIndex, 1, anArgsCount))
{
// bound has color
- if (CheckInputCommand ("c", argv, aArgIndex, 3, argc))
+ if (CheckInputCommand ("c", myArrayDescription, anArgIndex, 3, anArgsCount))
hasBColors = Standard_True;
aBoundNum++;
}
// edge command
- else if (CheckInputCommand ("e", argv, aArgIndex, 1, argc))
+ else if (CheckInputCommand ("e", myArrayDescription, anArgIndex, 1, anArgsCount))
{
// edge has a hide flag
- if (CheckInputCommand ("h", argv, aArgIndex, 0, argc))
+ if (CheckInputCommand ("h", myArrayDescription, anArgIndex, 0, anArgsCount))
hasInfos = Standard_True;
aEdgeNum++;
}
// unknown command
else
- aArgIndex++;
+ anArgIndex++;
}
- if (aVertexNum == 0)
- {
- di << "You should pass any verticies in the list of array elements\n";
- return 1;
- }
-
- // create an array of primitives by types
Handle(Graphic3d_ArrayOfPrimitives) anArray;
- Handle(Graphic3d_AspectMarker3d) anAspPoints;
if (anArrayType == "points")
{
anArray = new Graphic3d_ArrayOfPoints (aVertexNum);
- anAspPoints = new Graphic3d_AspectMarker3d (Aspect_TOM_POINT, Quantity_NOC_YELLOW, 1.0f);
}
else if (anArrayType == "segments")
anArray = new Graphic3d_ArrayOfSegments (aVertexNum, aEdgeNum, hasVColors);
anArray = new Graphic3d_ArrayOfPolygons (aVertexNum, aBoundNum, aEdgeNum,
hasNormals, hasVColors, hasBColors,
hasTexels, hasInfos);
- else
- {
- di << "Unexpected type of primitiives array\n";
- return 1;
- }
- // parse an array of primitives
- aArgIndex = anArgsFrom;
- while (aArgIndex < argc)
+ anArgIndex = 1;
+ while (anArgIndex < anArgsCount)
{
- aCommand = argv[aArgIndex];
+ aCommand = myArrayDescription->Value (anArgIndex);
aCommand.LowerCase();
if (!aCommand.IsAscii())
break;
// vertex command
- if (CheckInputCommand ("v", argv, aArgIndex, 3, argc))
+ if (CheckInputCommand ("v", myArrayDescription, anArgIndex, 3, anArgsCount))
{
- anArray->AddVertex (Draw::Atof (argv[aArgIndex - 3]),
- Draw::Atof (argv[aArgIndex - 2]),
- Draw::Atof (argv[aArgIndex - 1]));
+ anArray->AddVertex (myArrayDescription->Value (anArgIndex - 3).RealValue(),
+ myArrayDescription->Value (anArgIndex - 2).RealValue(),
+ myArrayDescription->Value (anArgIndex - 1).RealValue());
// vertex has a normal or normal with color or texel
- if (CheckInputCommand ("n", argv, aArgIndex, 3, argc))
+ if (CheckInputCommand ("n", myArrayDescription, anArgIndex, 3, anArgsCount))
anArray->SetVertexNormal (anArray->VertexNumber (),
- Draw::Atof (argv[aArgIndex - 3]),
- Draw::Atof (argv[aArgIndex - 2]),
- Draw::Atof (argv[aArgIndex - 1]));
+ myArrayDescription->Value (anArgIndex - 3).RealValue(),
+ myArrayDescription->Value (anArgIndex - 2).RealValue(),
+ myArrayDescription->Value (anArgIndex - 1).RealValue());
- if (CheckInputCommand ("c", argv, aArgIndex, 3, argc))
+ if (CheckInputCommand ("c", myArrayDescription, anArgIndex, 3, anArgsCount))
anArray->SetVertexColor (anArray->VertexNumber (),
- Draw::Atof (argv[aArgIndex - 3]),
- Draw::Atof (argv[aArgIndex - 2]),
- Draw::Atof (argv[aArgIndex - 1]));
+ myArrayDescription->Value (anArgIndex - 3).RealValue(),
+ myArrayDescription->Value (anArgIndex - 2).RealValue(),
+ myArrayDescription->Value (anArgIndex - 1).RealValue());
- if (CheckInputCommand ("t", argv, aArgIndex, 2, argc))
+ if (CheckInputCommand ("t", myArrayDescription, anArgIndex, 2, anArgsCount))
anArray->SetVertexTexel (anArray->VertexNumber (),
- Draw::Atof (argv[aArgIndex - 2]),
- Draw::Atof (argv[aArgIndex - 1]));
+ myArrayDescription->Value (anArgIndex - 2).RealValue(),
+ myArrayDescription->Value (anArgIndex - 1).RealValue());
}
// bounds command
- else if (CheckInputCommand ("b", argv, aArgIndex, 1, argc))
+ else if (CheckInputCommand ("b", myArrayDescription, anArgIndex, 1, anArgsCount))
{
- Standard_Integer aVertCount = Draw::Atoi (argv[aArgIndex - 1]);
+ Standard_Integer aVertCount = myArrayDescription->Value (anArgIndex - 1).IntegerValue();
- if (CheckInputCommand ("c", argv, aArgIndex, 3, argc))
+ if (CheckInputCommand ("c", myArrayDescription, anArgIndex, 3, anArgsCount))
anArray->AddBound (aVertCount,
- Draw::Atof (argv[aArgIndex - 3]),
- Draw::Atof (argv[aArgIndex - 2]),
- Draw::Atof (argv[aArgIndex - 1]));
+ myArrayDescription->Value (anArgIndex - 3).RealValue(),
+ myArrayDescription->Value (anArgIndex - 2).RealValue(),
+ myArrayDescription->Value (anArgIndex - 1).RealValue());
else
anArray->AddBound (aVertCount);
}
// edge command
- else if (CheckInputCommand ("e", argv, aArgIndex, 1, argc))
+ else if (CheckInputCommand ("e", myArrayDescription, anArgIndex, 1, anArgsCount))
{
- Standard_Integer aVertIndex = Draw::Atoi (argv[aArgIndex - 1]);
+ Standard_Integer aVertIndex = myArrayDescription->Value (anArgIndex - 1).IntegerValue();
// edge has/hasn't hide flag
- if (CheckInputCommand ("h", argv, aArgIndex, 0, argc))
+ if (CheckInputCommand ("h", myArrayDescription, anArgIndex, 0, anArgsCount))
anArray->AddEdge (aVertIndex, Standard_False);
else
anArray->AddEdge (aVertIndex, Standard_True);
}
// unknown command
else
- aArgIndex++;
+ anArgIndex++;
+ }
+
+ aPresentation->Clear();
+ if (!myMarkerAspect.IsNull())
+ {
+ Prs3d_Root::CurrentGroup (aPresentation)->SetGroupPrimitivesAspect (myMarkerAspect);
+ }
+ Prs3d_Root::CurrentGroup (aPresentation)->AddPrimitiveArray (anArray);
+}
+
+void MyPArrayObject::ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
+ const Standard_Integer /*theMode*/)
+{
+ Handle(SelectMgr_EntityOwner) anEntityOwner = new SelectMgr_EntityOwner (this);
+
+ Standard_Integer anArgIndex = 1;
+ while (anArgIndex < myArrayDescription->Length())
+ {
+ if (CheckInputCommand ("v", myArrayDescription, anArgIndex, 3, myArrayDescription->Length()))
+ {
+ gp_Pnt aPoint (myArrayDescription->Value (anArgIndex - 3).RealValue(),
+ myArrayDescription->Value (anArgIndex - 2).RealValue(),
+ myArrayDescription->Value (anArgIndex - 1).RealValue());
+ Handle(Select3D_SensitivePoint) aSensetivePoint = new Select3D_SensitivePoint (anEntityOwner, aPoint);
+ theSelection->Add (aSensetivePoint);
+ }
+ else
+ {
+ anArgIndex++;
+ }
+ }
+}
+
+bool MyPArrayObject::CheckInputCommand (const TCollection_AsciiString theCommand,
+ const Handle(TColStd_HArray1OfAsciiString) theArgsArray,
+ Standard_Integer &theArgIndex,
+ Standard_Integer theArgCount,
+ Standard_Integer theMaxArgs)
+{
+ // check if there is more elements than expected
+ if (theArgIndex >= theMaxArgs)
+ return false;
+
+ TCollection_AsciiString aStrCommand = theArgsArray->Value (theArgIndex);
+ aStrCommand.LowerCase();
+ if (aStrCommand.Search(theCommand) != 1 ||
+ theArgIndex + (theArgCount - 1) >= theMaxArgs)
+ return false;
+
+ // go to the first data element
+ theArgIndex++;
+
+ // check data if it can be converted to numeric
+ for (int aElement = 0; aElement < theArgCount; aElement++, theArgIndex++)
+ {
+ aStrCommand = theArgsArray->Value (theArgIndex);
+ if (!aStrCommand.IsRealValue())
+ return false;
+ }
+
+ return true;
+}
+
+//=============================================================================
+//function : VDrawPArray
+//purpose : Draws primitives array from list of vertexes, bounds, edges
+//=============================================================================
+
+static int VDrawPArray (Draw_Interpretor& di, Standard_Integer argc, const char** argv)
+{
+ Handle(AIS_InteractiveContext) aContextAIS = ViewerTest::GetAISContext();
+ if (aContextAIS.IsNull())
+ {
+ di << "Call vinit before!\n";
+ return 1;
+ }
+ else if (argc < 3)
+ {
+ di << "Use: " << argv[0] << " Name TypeOfArray"
+ << " [vertex] ... [bounds] ... [edges]\n"
+ << " TypeOfArray={ points | segments | polylines | triangles |\n"
+ << " trianglefans | trianglestrips | quads |\n"
+ << " quadstrips | polygons }\n"
+ << " vertex={ 'v' x y z [normal={ 'n' nx ny nz }] [color={ 'c' r g b }]"
+ << " [texel={ 't' tx ty }] } \n"
+ << " bounds={ 'b' verticies_count [color={ 'c' r g b }] }\n"
+ << " edges={ 'e' vertex_id [hidden_edge={'h'}] }\n";
+ return 1;
+ }
+
+ // read the arguments
+ Standard_Integer aArgIndex = 1;
+ TCollection_AsciiString aName (argv[aArgIndex++]);
+ TCollection_AsciiString anArrayType (argv[aArgIndex++]);
+
+ Standard_Boolean hasVertex = Standard_False;
+
+ Handle(TColStd_HArray1OfAsciiString) anArgsArray = new TColStd_HArray1OfAsciiString (0, argc - 2);
+ anArgsArray->SetValue (0, anArrayType);
+
+ if (anArrayType != "points" &&
+ anArrayType != "segments" &&
+ anArrayType != "polylines" &&
+ anArrayType != "triangles" &&
+ anArrayType != "trianglefans" &&
+ anArrayType != "trianglestrips" &&
+ anArrayType != "quads" &&
+ anArrayType != "quadstrips" &&
+ anArrayType != "polygons")
+ {
+ di << "Unexpected type of primitives array\n";
+ return 1;
+ }
+
+ TCollection_AsciiString aCommand;
+ for (Standard_Integer anArgIndex = 3; anArgIndex < argc; anArgIndex++)
+ {
+ aCommand = argv[anArgIndex];
+ aCommand.LowerCase();
+ if (!aCommand.IsAscii())
+ {
+ di << "Unexpected argument: #" << aArgIndex - 1 << " , "
+ << "should be an array element: 'v', 'b', 'e' \n";
+ break;
+ }
+
+ if (aCommand == "v")
+ {
+ hasVertex = Standard_True;
+ }
+
+ anArgsArray->SetValue (anArgIndex - 2, aCommand);
+ }
+
+ if (!hasVertex)
+ {
+ di << "You should pass any verticies in the list of array elements\n";
+ return 1;
+ }
+
+ Handle(Graphic3d_AspectMarker3d) anAspPoints;
+ if (anArrayType == "points")
+ {
+ anAspPoints = new Graphic3d_AspectMarker3d (Aspect_TOM_POINT, Quantity_NOC_YELLOW, 1.0f);
}
// create primitives array object
- Handle(MyPArrayObject) aPObject = new MyPArrayObject (anArray, anAspPoints);
+ Handle(MyPArrayObject) aPObject = new MyPArrayObject (anArgsArray, anAspPoints);
// register the object in map
VDisplayAISObject (aName, aPObject);
return 0;
}
+// This class is used for testing markers.
+DEFINE_STANDARD_HANDLE(ViewerTest_MarkersArrayObject, AIS_InteractiveObject)
+class ViewerTest_MarkersArrayObject : public AIS_InteractiveObject
+{
+
+public:
+
+ ViewerTest_MarkersArrayObject (const gp_XYZ& theStartPoint,
+ const Standard_Integer& thePointsOnSide,
+ Handle(Graphic3d_AspectMarker3d) theMarkerAspect = NULL)
+ {
+ myStartPoint = theStartPoint;
+ myPointsOnSide = thePointsOnSide;
+ myMarkerAspect = theMarkerAspect;
+ }
+
+ DEFINE_STANDARD_RTTI(MyPArrayObject);
+
+private:
+
+ void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
+ const Handle(Prs3d_Presentation)& aPresentation,
+ const Standard_Integer aMode);
+
+ void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
+ const Standard_Integer /*theMode*/);
+
+protected:
+
+ gp_XYZ myStartPoint;
+ Standard_Integer myPointsOnSide;
+ Handle(Graphic3d_AspectMarker3d) myMarkerAspect;
+};
+
+IMPLEMENT_STANDARD_HANDLE(ViewerTest_MarkersArrayObject, AIS_InteractiveObject)
+IMPLEMENT_STANDARD_RTTIEXT(ViewerTest_MarkersArrayObject, AIS_InteractiveObject)
+
+void ViewerTest_MarkersArrayObject::Compute (const Handle(PrsMgr_PresentationManager3d)& /*aPresentationManager*/,
+ const Handle(Prs3d_Presentation)& aPresentation,
+ const Standard_Integer /*aMode*/)
+{
+ Handle(Graphic3d_ArrayOfPrimitives) anArray = new Graphic3d_ArrayOfPoints ((Standard_Integer )Pow (myPointsOnSide, 3), myPointsOnSide != 1);
+ if (myPointsOnSide == 1)
+ {
+ anArray->AddVertex (myStartPoint);
+ }
+ else
+ {
+ for (Standard_Real i = 1; i <= myPointsOnSide; i++)
+ {
+ for (Standard_Real j = 1; j <= myPointsOnSide; j++)
+ {
+ for (Standard_Real k = 1; k <= myPointsOnSide; k++)
+ {
+ anArray->AddVertex (myStartPoint.X() + i, myStartPoint.Y() + j, myStartPoint.Z() + k);
+ anArray->SetVertexColor (anArray->VertexNumber(),
+ i / myPointsOnSide,
+ j / myPointsOnSide,
+ k / myPointsOnSide);
+ }
+ }
+ }
+ }
+
+ aPresentation->Clear();
+ if (!myMarkerAspect.IsNull())
+ {
+ Prs3d_Root::CurrentGroup (aPresentation)->SetGroupPrimitivesAspect (myMarkerAspect);
+ }
+ Prs3d_Root::CurrentGroup (aPresentation)->AddPrimitiveArray (anArray);
+}
+
+void ViewerTest_MarkersArrayObject::ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
+ const Standard_Integer /*theMode*/)
+{
+ Handle(SelectMgr_EntityOwner) anEntityOwner = new SelectMgr_EntityOwner (this);
+
+ if (myPointsOnSide == 1)
+ {
+ gp_Pnt aPoint (myStartPoint);
+ Handle(Select3D_SensitivePoint) aSensetivePoint = new Select3D_SensitivePoint (anEntityOwner, aPoint);
+ theSelection->Add (aSensetivePoint);
+ }
+ else
+ {
+ for (Standard_Real i = 1; i <= myPointsOnSide; i++)
+ {
+ for (Standard_Real j = 1; j <= myPointsOnSide; j++)
+ {
+ for (Standard_Real k = 1; k <= myPointsOnSide; k++)
+ {
+ gp_Pnt aPoint (myStartPoint.X() + i, myStartPoint.Y() + j, myStartPoint.Z() + k);
+ Handle(Select3D_SensitivePoint) aSensetivePoint = new Select3D_SensitivePoint (anEntityOwner, aPoint);
+ theSelection->Add (aSensetivePoint);
+ }
+ }
+ }
+ }
+}
//=======================================================================
//function : VMarkersTest
//purpose : Draws an array of markers for testing purposes.
anAspect = new Graphic3d_AspectMarker3d (aMarkerType >= 0 ? (Aspect_TypeOfMarker )aMarkerType : Aspect_TOM_POINT, aColor, aScale);
}
- Handle(Graphic3d_ArrayOfPrimitives) anArray = new Graphic3d_ArrayOfPoints ((Standard_Integer )Pow (aPointsOnSide, 3), aPointsOnSide != 1);
- if (aPointsOnSide == 1)
- {
- anArray->AddVertex (aPnt);
- }
- else
- {
- for (Standard_Real i = 1; i <= aPointsOnSide; i++)
- {
- for (Standard_Real j = 1; j <= aPointsOnSide; j++)
- {
- for (Standard_Real k = 1; k <= aPointsOnSide; k++)
- {
- anArray->AddVertex (aPnt.X() + i, aPnt.Y() + j, aPnt.Z() + k);
- anArray->SetVertexColor (anArray->VertexNumber(),
- i / aPointsOnSide,
- j / aPointsOnSide,
- k / aPointsOnSide);
- }
- }
- }
- }
-
- Handle(MyPArrayObject) aPObject = new MyPArrayObject (anArray, anAspect);
- VDisplayAISObject (aName, aPObject);
+ Handle(ViewerTest_MarkersArrayObject) aMarkersArray = new ViewerTest_MarkersArrayObject (aPnt, aPointsOnSide, anAspect);
+ VDisplayAISObject (aName, aMarkersArray);
return 0;
}
}
// Create viewer
- Handle(V3d_Viewer) a3DViewer, a3DCollector;
+ Handle(V3d_Viewer) a3DViewer;
// If it's the single view, we first look for empty context
if (ViewerTest_myViews.IsEmpty() && !ViewerTest_myContexts.IsEmpty())
{
if (anIter.More())
ViewerTest::SetAISContext (anIter.Value());
a3DViewer = ViewerTest::GetAISContext()->CurrentViewer();
- a3DCollector= ViewerTest::GetAISContext()->Collector();
}
else if (ViewerTest_myContexts.IsBound1(aViewNames.GetViewerName()))
{
ViewerTest::SetAISContext(ViewerTest_myContexts.Find1(aViewNames.GetViewerName()));
a3DViewer = ViewerTest::GetAISContext()->CurrentViewer();
- a3DCollector= ViewerTest::GetAISContext()->Collector();
}
- else if (a3DViewer.IsNull() || a3DCollector.IsNull())
+ else if (a3DViewer.IsNull())
{
toCreateViewer = Standard_True;
TCollection_ExtendedString NameOfWindow("Viewer3D");
a3DViewer = new V3d_Viewer(aGraphicDriver, NameOfWindow.ToExtString());
NameOfWindow = TCollection_ExtendedString("Collector");
- a3DCollector = new V3d_Viewer(aGraphicDriver, NameOfWindow.ToExtString());
a3DViewer->SetDefaultBackgroundColor(Quantity_NOC_BLACK);
- a3DCollector->SetDefaultBackgroundColor(Quantity_NOC_STEELBLUE);
}
// AIS context setup
!(ViewerTest_myContexts.IsBound1(aViewNames.GetViewerName())))
{
Handle(AIS_InteractiveContext) aContext =
- new AIS_InteractiveContext(a3DViewer, a3DCollector);
+ new AIS_InteractiveContext(a3DViewer);
ViewerTest::SetAISContext (aContext);
ViewerTest_myContexts.Bind (aViewNames.GetViewerName(), ViewerTest::GetAISContext());
}
aView.Nullify();
a3DViewer.Nullify();
- a3DCollector.Nullify();
return aViewNames.GetViewName();
}
Standard_Integer argc,
const char ** argv)
{
- if (argc > 2)
+ if (argc > 1)
{
- di << "Usage : " << argv[0] << " [CollectorToo = 0|1]" << "\n";
+ di << "Usage : " << argv[0] << "\n";
return 1;
}
- Standard_Boolean isCollectorToo = Standard_False;
- if (argc == 2)
- {
- isCollectorToo = (atoi(argv [1]) != 0);
- }
Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
if (aContext.IsNull())
{
return 1;
}
aContext->CloseAllContexts(Standard_False);
- di << aContext->PurgeDisplay(isCollectorToo) << "\n";
+ di << aContext->PurgeDisplay() << "\n";
return 0;
}
"vantialiasing 1|0",
__FILE__,VAntialiasing,group);
theCommands.Add ("vpurgedisplay",
- "vpurgedisplay [CollectorToo = 0|1]"
+ "vpurgedisplay"
"- removes structures which don't belong to objects displayed in neutral point",
__FILE__, VPurgeDisplay, group);
theCommands.Add("vsetviewsize",
if (! MyWindow->IsMapped ()) return;
+ if (MyGraphicDriver->IsDeviceLost())
+ {
+ MyViewManager->ReComputeStructures();
+ MyGraphicDriver->ResetDeviceLostFlag();
+ }
+
// If activation/desactivation of ZBuffer should be automatic
// depending on the presence or absence of facets.
if (MyViewManager->ZBufferAuto ()) {
Standard_Integer Index = IsComputed (AStructure);
if ((Index != 0) && (AStructure->Visual () != Graphic3d_TOS_COMPUTED)) {
-
-#ifdef TRACE_LENGTH
- if (MyTOCOMPUTESequence.Length () != MyCOMPUTEDSequence.Length ()) {
- cout << "In Visual3d_View::Display, ";
- cout << "TOCOMPUTE " << MyTOCOMPUTESequence.Length ()
- << " != COMPUTED " << MyCOMPUTEDSequence.Length ()
- << "\n" << flush;
- }
-#endif
MyTOCOMPUTESequence.Remove (Index);
MyCOMPUTEDSequence.Remove (Index);
-
-#ifdef TRACE_LENGTH
- if (MyTOCOMPUTESequence.Length () != MyCOMPUTEDSequence.Length ())
- cout << "\tTOCOMPUTE " << MyTOCOMPUTESequence.Length ()
- << " != COMPUTED " << MyCOMPUTEDSequence.Length ()
- << "\n" << flush;
-#endif
Index = 0;
}
Visual3d_TypeOfAnswer Answer = AcceptDisplay (AStructure);
-#ifdef TRACE_DISPLAY
- Standard_Integer StructId = AStructure->Identification ();
- cout << "Visual3d_View" << MyCView.ViewId << "::Display ("
- << StructId << ");\n";
- cout << flush;
-#endif
-
if (Answer == Visual3d_TOA_NO) {
-#ifdef TRACE_DISPLAY
- cout << "Answer : Visual3d_TOA_NO\n";
- cout << flush;
-#endif
return;
}
}
if (Answer == Visual3d_TOA_YES ) {
-#ifdef TRACE_DISPLAY
- cout << "Answer : Visual3d_TOA_YES\n";
- cout << flush;
-#endif
if (IsDisplayed (AStructure)) return;
MyGraphicDriver->DisplayStructure (
MyCView,
}
if (Answer == Visual3d_TOA_COMPUTE) {
-#ifdef TRACE_DISPLAY
- cout << "Answer : Visual3d_TOA_COMPUTE\n";
- cout << "Index : " << Index << "\n" << flush;
-#endif
if (Index != 0) {
// Already computed, is COMPUTED still valid?
-#ifdef TRACE_DISPLAY
- if (MyCOMPUTEDSequence.Value (Index)->HLRValidation ()) {
- cout << "Structure "
- << MyTOCOMPUTESequence.Value (Index)->Identification ()
- << "already calculated, in the view "
- << Identification () << ", par la structure "
- << MyCOMPUTEDSequence.Value (Index)->Identification ()
- << "\n was not recalculated as HLR is valid\n";
- cout << flush;
- }
- else {
- cout << "Structure "
- << MyTOCOMPUTESequence.Value (Index)->Identification ()
- << " already calculated, in the view "
- << Identification () << ", by the structure "
- << MyCOMPUTEDSequence.Value (Index)->Identification ()
- << "\n should be recalculated as HLR is invalid\n";
- cout << flush;
- }
-#endif
Standard_Integer OldStructId =
MyCOMPUTEDSequence.Value (Index)->Identification ();
#endif
TheStructure->SetHLRValidation (Standard_True);
-#ifdef TRACE_LENGTH
- if (MyTOCOMPUTESequence.Length () != MyCOMPUTEDSequence.Length ())
- cout << "\tTOCOMPUTE " << MyTOCOMPUTESequence.Length ()
- << " != COMPUTED " << MyCOMPUTEDSequence.Length ()
- << "\n" << flush;
-#endif
-
// TOCOMPUTE and COMPUTED associated to sequences are added
MyTOCOMPUTESequence.Append (AStructure);
MyCOMPUTEDSequence.Append (TheStructure);
-#ifdef TRACE_LENGTH
- if (MyTOCOMPUTESequence.Length () != MyCOMPUTEDSequence.Length ())
- cout << "\tTOCOMPUTE " << MyTOCOMPUTESequence.Length ()
- << " != COMPUTED " << MyCOMPUTEDSequence.Length ()
- << "\n" << flush;
-#endif
-
// The previous are removed if necessary
if (Index != 0) {
MyTOCOMPUTESequence.Remove (Index);
MyCOMPUTEDSequence.Remove (Index);
}
-#ifdef TRACE_LENGTH
- if (MyTOCOMPUTESequence.Length () != MyCOMPUTEDSequence.Length ())
- cout << "\tTOCOMPUTE " << MyTOCOMPUTESequence.Length ()
- << " != COMPUTED " << MyCOMPUTEDSequence.Length ()
- << "\n" << flush;
-#endif
-
// Return type of visualisation of the view
Visual3d_TypeOfVisualization ViewType = MyContext.Visualization ();
TheStructure->GraphicHighlight (Aspect_TOHM_COLOR);
}
-#ifdef TRACE_DISPLAY
- cout << "Structure " << StructId
- << " in the view " << Identification ()
- << " is calculated by the structure "
- << TheStructure->Identification ();
- if (Answer == Visual3d_TOA_YES)
- cout << " and displayed\n";
- else
- cout << " but not displayed\n";
- cout << flush;
-#endif
-
// It is displayed only if the calculated structure
// has a proper type corresponding to the one of the view.
if (Answer != Visual3d_TOA_NO) {
Iterator.More ();
Iterator.Next ()) {
+ if (!Iterator.Key()->IsVisible())
+ {
+ continue;
+ }
+
if ( (Iterator.Key ())->IsInfinite ()){
//XMin, YMin .... ZMax are initialized by means of infinite line data
(Iterator.Key ())->MinMaxValues (Xm, Ym, Zm, XM, YM, ZM);
// clear all structures whilst views are alive for correct GPU memory management
MyDisplayedStructure.Clear();
MyHighlightedStructure.Clear();
- MyVisibleStructure.Clear();
MyPickStructure.Clear();
// clear list of managed views
}
MyHighlightedStructure.Remove (AStructure);
- MyVisibleStructure.Remove (AStructure);
MyPickStructure.Remove (AStructure);
}
vdisplay b b2
vfit
verase b
-set CollectorToo 1
-if [catch {vpurgedisplay $CollectorToo} result] {
+if [catch {vpurgedisplay} result] {
puts "Faulty OCC2066"
} else {
puts "OK OCC2066"
--- /dev/null
+puts "========"
+puts "OCC23654 Markers recompute"
+puts "========"
+
+# reflects Aspect_TypeOfMarker enumeration
+set aMarkerTypeNames {
+ Aspect_TOM_POINT
+ Aspect_TOM_PLUS
+ Aspect_TOM_STAR
+ Aspect_TOM_X
+ Aspect_TOM_O
+ Aspect_TOM_O_POINT
+ Aspect_TOM_O_PLUS
+ Aspect_TOM_O_STAR
+ Aspect_TOM_O_X
+ Aspect_TOM_RING1
+ Aspect_TOM_RING2
+ Aspect_TOM_RING3
+ Aspect_TOM_BALL
+ Aspect_TOM_USERDEFINED
+}
+
+# generate custom marker
+set aCustom1 $imagedir/${casename}_m1.png
+set aCustom2 $imagedir/${casename}_m2.png
+box b 1 1 1
+vinit name=Driver1/Viewer1/View1 l=32 t=32 w=512 h=512
+vclear
+vdisplay b
+vaxo
+vfit
+vdump $aCustom1 rgba 32 32
+vsetdispmode b 1
+vsetcolor b RED
+vrotate 1 0 0
+vdump $aCustom2 rgba 32 32
+
+# draw box in advance which should fit all our markers
+box b -8 -8 0 16 16 2
+
+vcaps sprites=1
+set aV "Driver1/Viewer1/View1"
+vinit name=$aV l=32 t=32 w=512 h=512
+vactivate $aV
+vclear
+
+vbottom
+vdisplay b
+vfit
+verase b
+
+for { set aMarkerType 0 } { $aMarkerType <= 13 } { incr aMarkerType } {
+ set aRow [expr $aMarkerType - 7]
+ set aCol 5
+ set aName [lindex $aMarkerTypeNames $aMarkerType]
+ vdrawtext "$aName" 0 [expr $aRow + 0.5] 0 128 255 255 1 1 000 0 12 2 Arial
+ if { $aMarkerType == 13 } {
+ vmarkerstest m${aMarkerType}_${aCol} $aCol $aRow 0 PointsOnSide=1 FileName=$aCustom1
+ set aCol [expr $aCol - 1]
+ vmarkerstest m${aMarkerType}_${aCol} $aCol $aRow 0 PointsOnSide=1 FileName=$aCustom2
+ } else {
+ for { set aMarkerScale 1.0 } { $aMarkerScale <= 7 } { set aMarkerScale [expr $aMarkerScale + 0.5] } {
+ vmarkerstest m${aMarkerType}_${aCol} $aCol $aRow 0 MarkerType=$aMarkerType Scale=$aMarkerScale PointsOnSide=1
+ set aCol [expr $aCol - 1]
+ }
+ }
+}
+
+set anImage1 $imagedir/${casename}_1.png
+set anImage2 $imagedir/${casename}_2.png
+
+vdump $anImage1
+
+vclose $aV 1
+
+vinit name=$aV l=32 t=32 w=512 h=512
+vactivate $aV
+vbottom
+vdisplay b
+vfit
+verase b
+
+vdump $anImage2
\ No newline at end of file