mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-16 10:08:36 +03:00
0028407: Visualization - remove ::UpdateMode() from Graphic3d_StructureManager
This commit is contained in:
parent
b0d96eb753
commit
cfece3ef2e
@ -887,7 +887,7 @@ void UserDrawObject::Compute (const Handle(PrsMgr_PresentationManager3d)& thePrs
|
|||||||
aGroup->AddElement(anElem);
|
aGroup->AddElement(anElem);
|
||||||
|
|
||||||
// invalidate bounding box of the scene
|
// invalidate bounding box of the scene
|
||||||
thePrsMgr->StructureManager()->Update (thePrsMgr->StructureManager()->UpdateMode());
|
thePrsMgr->StructureManager()->Update();
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
|
||||||
@ -1200,6 +1200,13 @@ The follow AIS_InteractiveContext methods have been changed:
|
|||||||
UpdateSelected, AddOrRemoveSelected, HilightSelected, UnhilightSelected, ClearSelected, ResetOriginalState,
|
UpdateSelected, AddOrRemoveSelected, HilightSelected, UnhilightSelected, ClearSelected, ResetOriginalState,
|
||||||
SubIntensityOn, SubIntensityOff, FitSelected, EraseGlobal, ClearGlobal, ClearGlobalPrs.
|
SubIntensityOn, SubIntensityOff, FitSelected, EraseGlobal, ClearGlobal, ClearGlobalPrs.
|
||||||
|
|
||||||
|
In addition, the API for immediate viewer update has been removed from V3d_View and Graphic3d_StructureManager classes
|
||||||
|
(enumerations *Aspect_TypeOfUpdate* and *V3d_TypeOfUpdate*):
|
||||||
|
V3d::SetUpdateMode(), V3d::UpdateMode(), Graphic3d_StructureManager::SetUpdateMode(), Graphic3d_StructureManager::UpdateMode().
|
||||||
|
|
||||||
|
The argument theUpdateMode has been removed from methods Graphic3d_CView::Display(), ::Erase(), ::Update().
|
||||||
|
Method Graphic3d_CView::Update() does not redraw the view and does not re-compute structures anymore.
|
||||||
|
|
||||||
@subsection upgrade_720_Result_Of_BOP_On_Containers Result of Boolean operations on containers
|
@subsection upgrade_720_Result_Of_BOP_On_Containers Result of Boolean operations on containers
|
||||||
|
|
||||||
* The result of Boolean operations on arguments of collection types (WIRE/SHELL/COMPSOLID) is now filtered from duplicating containers.
|
* The result of Boolean operations on arguments of collection types (WIRE/SHELL/COMPSOLID) is now filtered from duplicating containers.
|
||||||
|
@ -1945,63 +1945,51 @@ The *V3d* package is basically a set of tools directed by commands from the vie
|
|||||||
|
|
||||||
@subsubsection occt_visu_4_4_2 A programming example
|
@subsubsection occt_visu_4_4_2 A programming example
|
||||||
|
|
||||||
This sample TEST program for the *V3d* Package uses primary packages *Xw* and *Graphic3d* and secondary packages *Visual3d, Aspect, Quantity, Phigs* and *math*.
|
This sample TEST program for the *V3d* Package uses primary packages *Xw* and *Graphic3d* and secondary packages *Visual3d, Aspect, Quantity* and *math*.
|
||||||
|
|
||||||
~~~~~
|
~~~~~
|
||||||
//Create a default display connection
|
// Create a default display connection
|
||||||
Handle(Aspect_DisplayConnection) aDisplayConnection = new Aspect_DisplayConnection();
|
Handle(Aspect_DisplayConnection) aDispConnection = new Aspect_DisplayConnection();
|
||||||
|
|
||||||
//Create a Graphic Driver from the default Aspect_DisplayConnection
|
// Create a Graphic Driver from the default Aspect_DisplayConnection
|
||||||
Handle(OpenGl_GraphicDriver) GD = new OpenGl_GraphicDriver (aDisplayConnection);
|
Handle(OpenGl_GraphicDriver) aGraphicDriver = new OpenGl_GraphicDriver (aDispConnection);
|
||||||
|
|
||||||
//Create a Viewer to this Driver
|
// Create a Viewer to this Driver
|
||||||
Handle(V3d_Viewer) VM = new V3d_Viewer(GD, 400.,
|
Handle(V3d_Viewer) VM = new V3d_Viewer (aGraphicDriver);
|
||||||
// Space size
|
VM->SetDefaultBackgroundColor (Quantity_NOC_DARKVIOLET);
|
||||||
V3d_Xpos,
|
VM->SetDefaultViewProj (V3d_Xpos);
|
||||||
// Default projection
|
// Create a structure in this Viewer
|
||||||
Quantity_NOC_DARKVIOLET,
|
Handle(Graphic3d_Structure) aStruct = new Graphic3d_Structure (VM->Viewer());
|
||||||
// Default background
|
|
||||||
V3d_ZBUFFER,
|
|
||||||
// Type of visualization
|
|
||||||
V3d_GOURAUD,
|
|
||||||
// Shading model
|
|
||||||
V3d_WAIT);
|
|
||||||
// Update mode
|
|
||||||
// Create a structure in this Viewer
|
|
||||||
Handle(Graphic3d_Structure) S = new Graphic3d_Structure(VM->Viewer()) ;
|
|
||||||
|
|
||||||
// Type of structure
|
// Type of structure
|
||||||
S->SetVisual (Graphic3d_TOS_SHADING);
|
aStruct->SetVisual (Graphic3d_TOS_SHADING);
|
||||||
|
|
||||||
// Create a group of primitives in this structure
|
// Create a group of primitives in this structure
|
||||||
Handle(Graphic3d_Group) G = new Graphic3d_Group(S) ;
|
Handle(Graphic3d_Group) aPrsGroup = new Graphic3d_Group (aStruct);
|
||||||
|
|
||||||
// Fill this group with one polygon of size 100
|
// Fill this group with one quad of size 100
|
||||||
Graphic3d_Array1OfVertex Points(0,3) ;
|
Handle(Graphic3d_ArrayOfTriangleStrips) aTriangles = new Graphic3d_ArrayOfTriangleStrips (4);
|
||||||
Points(0).SetCoord(-100./2.,-100./2.,-100./2.) ;
|
aTriangles->AddVertex (-100./2., -100./2., 0.0);
|
||||||
Points(1).SetCoord(-100./2., 100./2.,-100./2.) ;
|
aTriangles->AddVertex (-100./2., 100./2., 0.0);
|
||||||
Points(2).SetCoord( 100./2., 100./2.,-100./2.) ;
|
aTriangles->AddVertex ( 100./2., -100./2., 0.0);
|
||||||
Points(3).SetCoord( 100./2.,-100./2.,-100./2.) ;
|
aTriangles->AddVertex ( 100./2., 100./2., 0.0);
|
||||||
Normal.SetCoord(0.,0.,1.) ;
|
aPrsGroup->Polygon (aTriangles);
|
||||||
G->Polygon(Points,Normal) ;
|
|
||||||
|
|
||||||
// Create Ambient and Infinite Lights in this Viewer
|
// Create Ambient and Infinite Lights in this Viewer
|
||||||
Handle(V3d_AmbientLight) L1 = new V3d_AmbientLight
|
Handle(V3d_AmbientLight) aLight1 = new V3d_AmbientLight (VM, Quantity_NOC_GRAY50);
|
||||||
(VM,Quantity_NOC_GRAY50) ;
|
Handle(V3d_DirectionalLight) aLight2 = new V3d_DirectionalLight (VM, V3d_XnegYnegZneg, Quantity_NOC_WHITE);
|
||||||
Handle(V3d_DirectionalLight) L2 = new V3d_DirectionalLight
|
|
||||||
(VM,V3d_XnegYnegZneg,Quantity_NOC_WHITE) ;
|
|
||||||
|
|
||||||
// Create a 3D quality Window with the same DisplayConnection
|
// Create a 3D quality Window with the same DisplayConnection
|
||||||
Handle(Xw_Window) W = new Xw_Window(aDisplayConnection,"Test V3d",0.5,0.5,0.5,0.5) ;
|
Handle(Xw_Window) aWindow = new Xw_Window (aDispConnection, "Test V3d", 0.5, 0.5, 0.5, 0.5);
|
||||||
|
|
||||||
// Map this Window to this screen
|
// Map this Window to this screen
|
||||||
W->Map() ;
|
aWindow->Map();
|
||||||
|
|
||||||
// Create a Perspective View in this Viewer
|
// Create a Perspective View in this Viewer
|
||||||
Handle(V3d_View) aView = new V3d_View(VM);
|
Handle(V3d_View) aView = new V3d_View (VM);
|
||||||
aView->Camera()->SetProjectionType (Graphic3d_Camera::Projection_Perspective);
|
aView->Camera()->SetProjectionType (Graphic3d_Camera::Projection_Perspective);
|
||||||
// Associate this View with the Window
|
// Associate this View with the Window
|
||||||
aView ->SetWindow(W);
|
aView ->SetWindow (aWindow);
|
||||||
// Display ALL structures in this View
|
// Display ALL structures in this View
|
||||||
VM->Viewer()->Display();
|
VM->Viewer()->Display();
|
||||||
// Finally update the Visualization in this View
|
// Finally update the Visualization in this View
|
||||||
|
@ -1,29 +0,0 @@
|
|||||||
// Created by: NW,JPB,CAL
|
|
||||||
// Copyright (c) 1991-1999 Matra Datavision
|
|
||||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
|
||||||
//
|
|
||||||
// This file is part of Open CASCADE Technology software library.
|
|
||||||
//
|
|
||||||
// This library is free software; you can redistribute it and/or modify it under
|
|
||||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
|
||||||
// by the Free Software Foundation, with special exception defined in the file
|
|
||||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
|
||||||
// distribution for complete text of the license and disclaimer of any warranty.
|
|
||||||
//
|
|
||||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
|
||||||
// commercial license or contractual agreement.
|
|
||||||
|
|
||||||
#ifndef _Aspect_TypeOfUpdate_HeaderFile
|
|
||||||
#define _Aspect_TypeOfUpdate_HeaderFile
|
|
||||||
|
|
||||||
//! Definition of screen refresh mode
|
|
||||||
//!
|
|
||||||
//! TOU_ASAP as soon as possible
|
|
||||||
//! TOU_WAIT on demand (Update)
|
|
||||||
enum Aspect_TypeOfUpdate
|
|
||||||
{
|
|
||||||
Aspect_TOU_ASAP,
|
|
||||||
Aspect_TOU_WAIT
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // _Aspect_TypeOfUpdate_HeaderFile
|
|
@ -53,7 +53,6 @@ Aspect_TypeOfPrimitive.hxx
|
|||||||
Aspect_TypeOfResize.hxx
|
Aspect_TypeOfResize.hxx
|
||||||
Aspect_TypeOfStyleText.hxx
|
Aspect_TypeOfStyleText.hxx
|
||||||
Aspect_TypeOfTriedronPosition.hxx
|
Aspect_TypeOfTriedronPosition.hxx
|
||||||
Aspect_TypeOfUpdate.hxx
|
|
||||||
Aspect_Units.hxx
|
Aspect_Units.hxx
|
||||||
Aspect_WidthOfLine.hxx
|
Aspect_WidthOfLine.hxx
|
||||||
Aspect_Window.cxx
|
Aspect_Window.cxx
|
||||||
|
@ -86,12 +86,12 @@ void Graphic3d_CView::Activate()
|
|||||||
if (anAnswer == Graphic3d_TOA_YES
|
if (anAnswer == Graphic3d_TOA_YES
|
||||||
|| anAnswer == Graphic3d_TOA_COMPUTE)
|
|| anAnswer == Graphic3d_TOA_COMPUTE)
|
||||||
{
|
{
|
||||||
Display (aStruct, Aspect_TOU_WAIT);
|
Display (aStruct);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Update (myStructureManager->UpdateMode());
|
Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
@ -122,11 +122,11 @@ void Graphic3d_CView::Deactivate()
|
|||||||
if (anAnswer == Graphic3d_TOA_YES
|
if (anAnswer == Graphic3d_TOA_YES
|
||||||
|| anAnswer == Graphic3d_TOA_COMPUTE)
|
|| anAnswer == Graphic3d_TOA_COMPUTE)
|
||||||
{
|
{
|
||||||
Erase (aStruct, Aspect_TOU_WAIT);
|
Erase (aStruct);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Update (myStructureManager->UpdateMode());
|
Update();
|
||||||
myIsActive = Standard_False;
|
myIsActive = Standard_False;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -146,7 +146,7 @@ void Graphic3d_CView::Remove()
|
|||||||
|
|
||||||
for (Graphic3d_MapIteratorOfMapOfStructure aStructIter (aDisplayedStructs); aStructIter.More(); aStructIter.Next())
|
for (Graphic3d_MapIteratorOfMapOfStructure aStructIter (aDisplayedStructs); aStructIter.More(); aStructIter.Next())
|
||||||
{
|
{
|
||||||
Erase (aStructIter.Value(), Aspect_TOU_WAIT);
|
Erase (aStructIter.Value());
|
||||||
}
|
}
|
||||||
|
|
||||||
myStructsToCompute.Clear();
|
myStructsToCompute.Clear();
|
||||||
@ -212,7 +212,7 @@ void Graphic3d_CView::SetComputedMode (const Standard_Boolean theMode)
|
|||||||
eraseStructure (aStruct->CStructure());
|
eraseStructure (aStruct->CStructure());
|
||||||
displayStructure (myStructsComputed.Value (anIndex)->CStructure(), aStruct->DisplayPriority());
|
displayStructure (myStructsComputed.Value (anIndex)->CStructure(), aStruct->DisplayPriority());
|
||||||
|
|
||||||
Display (aStruct, Aspect_TOU_WAIT);
|
Display (aStruct);
|
||||||
if (aStruct->IsHighlighted())
|
if (aStruct->IsHighlighted())
|
||||||
{
|
{
|
||||||
const Handle(Graphic3d_Structure)& aCompStruct = myStructsComputed.Value (anIndex);
|
const Handle(Graphic3d_Structure)& aCompStruct = myStructsComputed.Value (anIndex);
|
||||||
@ -262,7 +262,7 @@ void Graphic3d_CView::SetComputedMode (const Standard_Boolean theMode)
|
|||||||
displayStructure (aCompStruct->CStructure(), aStruct->DisplayPriority());
|
displayStructure (aCompStruct->CStructure(), aStruct->DisplayPriority());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Update (myStructureManager->UpdateMode());
|
Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
@ -347,16 +347,9 @@ void Graphic3d_CView::ReCompute (const Handle(Graphic3d_Structure)& theStruct)
|
|||||||
// function : Update
|
// function : Update
|
||||||
// purpose :
|
// purpose :
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
void Graphic3d_CView::Update (const Aspect_TypeOfUpdate theUpdateMode,
|
void Graphic3d_CView::Update (const Graphic3d_ZLayerId theLayerId)
|
||||||
const Graphic3d_ZLayerId theLayerId)
|
|
||||||
{
|
{
|
||||||
InvalidateZLayerBoundingBox (theLayerId);
|
InvalidateZLayerBoundingBox (theLayerId);
|
||||||
|
|
||||||
if (theUpdateMode == Aspect_TOU_ASAP)
|
|
||||||
{
|
|
||||||
Compute();
|
|
||||||
Redraw();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
@ -589,10 +582,9 @@ Graphic3d_TypeOfAnswer Graphic3d_CView::acceptDisplay (const Graphic3d_TypeOfStr
|
|||||||
void Graphic3d_CView::Compute()
|
void Graphic3d_CView::Compute()
|
||||||
{
|
{
|
||||||
// force HLRValidation to False on all structures calculated in the view
|
// force HLRValidation to False on all structures calculated in the view
|
||||||
const Standard_Integer aNbCompStructs = myStructsComputed.Length();
|
for (Graphic3d_SequenceOfStructure::Iterator aStructIter (myStructsComputed); aStructIter.More(); aStructIter.Next())
|
||||||
for (Standard_Integer aStructIter = 1; aStructIter <= aNbCompStructs; ++aStructIter)
|
|
||||||
{
|
{
|
||||||
myStructsComputed.Value (aStructIter)->SetHLRValidation (Standard_False);
|
aStructIter.Value()->SetHLRValidation (Standard_False);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ComputedMode())
|
if (!ComputedMode())
|
||||||
@ -615,7 +607,7 @@ void Graphic3d_CView::Compute()
|
|||||||
|
|
||||||
for (NCollection_Sequence<Handle(Graphic3d_Structure)>::Iterator aStructIter (aStructsSeq); aStructIter.More(); aStructIter.Next())
|
for (NCollection_Sequence<Handle(Graphic3d_Structure)>::Iterator aStructIter (aStructsSeq); aStructIter.More(); aStructIter.Next())
|
||||||
{
|
{
|
||||||
Display (aStructIter.ChangeValue(), Aspect_TOU_WAIT);
|
Display (aStructIter.ChangeValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -676,16 +668,6 @@ void Graphic3d_CView::Disconnect (const Handle(Graphic3d_Structure)& theMother,
|
|||||||
// purpose :
|
// purpose :
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
void Graphic3d_CView::Display (const Handle(Graphic3d_Structure)& theStructure)
|
void Graphic3d_CView::Display (const Handle(Graphic3d_Structure)& theStructure)
|
||||||
{
|
|
||||||
Display (theStructure, myStructureManager->UpdateMode());
|
|
||||||
}
|
|
||||||
|
|
||||||
// =======================================================================
|
|
||||||
// function : Display
|
|
||||||
// purpose :
|
|
||||||
// =======================================================================
|
|
||||||
void Graphic3d_CView::Display (const Handle(Graphic3d_Structure)& theStructure,
|
|
||||||
const Aspect_TypeOfUpdate theUpdateMode)
|
|
||||||
{
|
{
|
||||||
if (!IsActive())
|
if (!IsActive())
|
||||||
{
|
{
|
||||||
@ -725,7 +707,7 @@ void Graphic3d_CView::Display (const Handle(Graphic3d_Structure)& theStructure,
|
|||||||
|
|
||||||
theStructure->CalculateBoundBox();
|
theStructure->CalculateBoundBox();
|
||||||
displayStructure (theStructure->CStructure(), theStructure->DisplayPriority());
|
displayStructure (theStructure->CStructure(), theStructure->DisplayPriority());
|
||||||
Update (theUpdateMode, theStructure->GetZLayer());
|
Update (theStructure->GetZLayer());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (anAnswer != Graphic3d_TOA_COMPUTE)
|
else if (anAnswer != Graphic3d_TOA_COMPUTE)
|
||||||
@ -746,7 +728,7 @@ void Graphic3d_CView::Display (const Handle(Graphic3d_Structure)& theStructure,
|
|||||||
}
|
}
|
||||||
|
|
||||||
displayStructure (anOldStruct->CStructure(), theStructure->DisplayPriority());
|
displayStructure (anOldStruct->CStructure(), theStructure->DisplayPriority());
|
||||||
Update (theUpdateMode, anOldStruct->GetZLayer());
|
Update (anOldStruct->GetZLayer());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -769,7 +751,7 @@ void Graphic3d_CView::Display (const Handle(Graphic3d_Structure)& theStructure,
|
|||||||
const Handle(Graphic3d_Structure)& aNewStruct = myStructsComputed.Value (aNewIndex);
|
const Handle(Graphic3d_Structure)& aNewStruct = myStructsComputed.Value (aNewIndex);
|
||||||
myStructsComputed.SetValue (anIndex, aNewStruct);
|
myStructsComputed.SetValue (anIndex, aNewStruct);
|
||||||
displayStructure (aNewStruct->CStructure(), theStructure->DisplayPriority());
|
displayStructure (aNewStruct->CStructure(), theStructure->DisplayPriority());
|
||||||
Update (theUpdateMode, aNewStruct->GetZLayer());
|
Update (aNewStruct->GetZLayer());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -849,7 +831,7 @@ void Graphic3d_CView::Display (const Handle(Graphic3d_Structure)& theStructure,
|
|||||||
myStructsDisplayed.Add (theStructure);
|
myStructsDisplayed.Add (theStructure);
|
||||||
displayStructure (aStruct->CStructure(), theStructure->DisplayPriority());
|
displayStructure (aStruct->CStructure(), theStructure->DisplayPriority());
|
||||||
|
|
||||||
Update (theUpdateMode, aStruct->GetZLayer());
|
Update (aStruct->GetZLayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
@ -857,16 +839,6 @@ void Graphic3d_CView::Display (const Handle(Graphic3d_Structure)& theStructure,
|
|||||||
// purpose :
|
// purpose :
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
void Graphic3d_CView::Erase (const Handle(Graphic3d_Structure)& theStructure)
|
void Graphic3d_CView::Erase (const Handle(Graphic3d_Structure)& theStructure)
|
||||||
{
|
|
||||||
Erase (theStructure, myStructureManager->UpdateMode());
|
|
||||||
}
|
|
||||||
|
|
||||||
// =======================================================================
|
|
||||||
// function : Erase
|
|
||||||
// purpose :
|
|
||||||
// =======================================================================
|
|
||||||
void Graphic3d_CView::Erase (const Handle(Graphic3d_Structure)& theStructure,
|
|
||||||
const Aspect_TypeOfUpdate theUpdateMode)
|
|
||||||
{
|
{
|
||||||
if (!IsDisplayed (theStructure))
|
if (!IsDisplayed (theStructure))
|
||||||
{
|
{
|
||||||
@ -893,7 +865,7 @@ void Graphic3d_CView::Erase (const Handle(Graphic3d_Structure)& theStructure,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
myStructsDisplayed.Remove (theStructure);
|
myStructsDisplayed.Remove (theStructure);
|
||||||
Update (theUpdateMode, theStructure->GetZLayer());
|
Update (theStructure->GetZLayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
#include <Aspect_Handle.hxx>
|
#include <Aspect_Handle.hxx>
|
||||||
#include <Aspect_RenderingContext.hxx>
|
#include <Aspect_RenderingContext.hxx>
|
||||||
#include <Aspect_TypeOfUpdate.hxx>
|
|
||||||
#include <Aspect_Window.hxx>
|
#include <Aspect_Window.hxx>
|
||||||
#include <Graphic3d_BufferType.hxx>
|
#include <Graphic3d_BufferType.hxx>
|
||||||
#include <Graphic3d_Camera.hxx>
|
#include <Graphic3d_Camera.hxx>
|
||||||
@ -106,10 +105,11 @@ public:
|
|||||||
//! Computes the new presentation of the structure displayed in this view with the type Graphic3d_TOS_COMPUTED.
|
//! Computes the new presentation of the structure displayed in this view with the type Graphic3d_TOS_COMPUTED.
|
||||||
Standard_EXPORT void ReCompute (const Handle(Graphic3d_Structure)& theStructure);
|
Standard_EXPORT void ReCompute (const Handle(Graphic3d_Structure)& theStructure);
|
||||||
|
|
||||||
//! Updates screen in function of modifications of the structures
|
//! Invalidates bounding box of specified ZLayerId.
|
||||||
//! and invalidates bounding box of specified ZLayerId.
|
Standard_EXPORT void Update (const Graphic3d_ZLayerId theLayerId = Graphic3d_ZLayerId_UNKNOWN);
|
||||||
Standard_EXPORT void Update (const Aspect_TypeOfUpdate theUpdateMode,
|
|
||||||
const Graphic3d_ZLayerId theLayerId = Graphic3d_ZLayerId_UNKNOWN);
|
//! Computes the new presentation of the structures displayed in this view with the type Graphic3d_TOS_COMPUTED.
|
||||||
|
Standard_EXPORT void Compute();
|
||||||
|
|
||||||
//! Returns Standard_True if one of the structures displayed in the view contains Polygons, Triangles or Quadrangles.
|
//! Returns Standard_True if one of the structures displayed in the view contains Polygons, Triangles or Quadrangles.
|
||||||
Standard_EXPORT Standard_Boolean ContainsFacet() const;
|
Standard_EXPORT Standard_Boolean ContainsFacet() const;
|
||||||
@ -158,9 +158,6 @@ private:
|
|||||||
//! Is it possible to display the structure in the view?
|
//! Is it possible to display the structure in the view?
|
||||||
Standard_EXPORT Graphic3d_TypeOfAnswer acceptDisplay (const Graphic3d_TypeOfStructure theStructType) const;
|
Standard_EXPORT Graphic3d_TypeOfAnswer acceptDisplay (const Graphic3d_TypeOfStructure theStructType) const;
|
||||||
|
|
||||||
//! Computes the new presentation of the structures displayed in this view with the type Graphic3d_TOS_COMPUTED.
|
|
||||||
Standard_EXPORT void Compute();
|
|
||||||
|
|
||||||
//! Clears the structure in this view.
|
//! Clears the structure in this view.
|
||||||
Standard_EXPORT void Clear (const Handle(Graphic3d_Structure)& theStructure, const Standard_Boolean theWithDestruction);
|
Standard_EXPORT void Clear (const Handle(Graphic3d_Structure)& theStructure, const Standard_Boolean theWithDestruction);
|
||||||
|
|
||||||
@ -175,17 +172,9 @@ private:
|
|||||||
//! Displays the structure in the view.
|
//! Displays the structure in the view.
|
||||||
Standard_EXPORT void Display (const Handle(Graphic3d_Structure)& theStructure);
|
Standard_EXPORT void Display (const Handle(Graphic3d_Structure)& theStructure);
|
||||||
|
|
||||||
//! Display the structure in the view.
|
|
||||||
Standard_EXPORT void Display (const Handle(Graphic3d_Structure)& theStructure,
|
|
||||||
const Aspect_TypeOfUpdate theUpdateMode);
|
|
||||||
|
|
||||||
//! Erases the structure from the view.
|
//! Erases the structure from the view.
|
||||||
Standard_EXPORT void Erase (const Handle(Graphic3d_Structure)& theStructure);
|
Standard_EXPORT void Erase (const Handle(Graphic3d_Structure)& theStructure);
|
||||||
|
|
||||||
//! Erases the structure from the view.
|
|
||||||
Standard_EXPORT void Erase (const Handle(Graphic3d_Structure)& theStructure,
|
|
||||||
const Aspect_TypeOfUpdate theUpdateMode);
|
|
||||||
|
|
||||||
//! Highlights the structure in the view.
|
//! Highlights the structure in the view.
|
||||||
Standard_EXPORT void Highlight (const Handle(Graphic3d_Structure)& theStructure);
|
Standard_EXPORT void Highlight (const Handle(Graphic3d_Structure)& theStructure);
|
||||||
|
|
||||||
|
@ -208,7 +208,7 @@ void Graphic3d_Group::Update() const
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
myStructure->StructureManager()->Update (myStructure->StructureManager()->UpdateMode());
|
myStructure->StructureManager()->Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
|
@ -619,24 +619,10 @@ void Graphic3d_Structure::SetVisual (const Graphic3d_TypeOfStructure theVisual)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Aspect_TypeOfUpdate anUpdateMode = myStructureManager->UpdateMode();
|
Erase();
|
||||||
if (anUpdateMode == Aspect_TOU_WAIT)
|
myVisual = theVisual;
|
||||||
{
|
SetComputeVisual (theVisual);
|
||||||
Erase();
|
Display();
|
||||||
myVisual = theVisual;
|
|
||||||
SetComputeVisual (theVisual);
|
|
||||||
Display();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// To avoid calling method : Update ()
|
|
||||||
// Not useful and can be costly.
|
|
||||||
myStructureManager->SetUpdateMode (Aspect_TOU_WAIT);
|
|
||||||
Erase();
|
|
||||||
myVisual = theVisual;
|
|
||||||
SetComputeVisual (theVisual);
|
|
||||||
myStructureManager->SetUpdateMode (anUpdateMode);
|
|
||||||
Display();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1254,8 +1240,7 @@ void Graphic3d_Structure::Update (const bool theUpdateLayer) const
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
myStructureManager->Update (myStructureManager->UpdateMode(),
|
myStructureManager->Update (theUpdateLayer ? myCStructure->ZLayer() : Graphic3d_ZLayerId_UNKNOWN);
|
||||||
theUpdateLayer ? myCStructure->ZLayer() : Graphic3d_ZLayerId_UNKNOWN);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
@ -30,7 +30,6 @@ IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_StructureManager,MMgt_TShared)
|
|||||||
// ========================================================================
|
// ========================================================================
|
||||||
Graphic3d_StructureManager::Graphic3d_StructureManager (const Handle(Graphic3d_GraphicDriver)& theDriver)
|
Graphic3d_StructureManager::Graphic3d_StructureManager (const Handle(Graphic3d_GraphicDriver)& theDriver)
|
||||||
: myViewGenId (0, 31),
|
: myViewGenId (0, 31),
|
||||||
myUpdateMode (Aspect_TOU_WAIT),
|
|
||||||
myGraphicDriver (theDriver)
|
myGraphicDriver (theDriver)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@ -51,12 +50,11 @@ Graphic3d_StructureManager::~Graphic3d_StructureManager()
|
|||||||
// function : Update
|
// function : Update
|
||||||
// purpose :
|
// purpose :
|
||||||
// ========================================================================
|
// ========================================================================
|
||||||
void Graphic3d_StructureManager::Update (const Aspect_TypeOfUpdate theMode,
|
void Graphic3d_StructureManager::Update (const Graphic3d_ZLayerId theLayerId) const
|
||||||
const Graphic3d_ZLayerId theLayerId) const
|
|
||||||
{
|
{
|
||||||
for (Graphic3d_IndexedMapOfView::Iterator aViewIt (myDefinedViews); aViewIt.More(); aViewIt.Next())
|
for (Graphic3d_IndexedMapOfView::Iterator aViewIt (myDefinedViews); aViewIt.More(); aViewIt.Next())
|
||||||
{
|
{
|
||||||
aViewIt.Value()->Update (theMode, theLayerId);
|
aViewIt.Value()->Update (theLayerId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
#include <Aspect_GenId.hxx>
|
#include <Aspect_GenId.hxx>
|
||||||
#include <Aspect_TypeOfHighlightMethod.hxx>
|
#include <Aspect_TypeOfHighlightMethod.hxx>
|
||||||
#include <Aspect_TypeOfUpdate.hxx>
|
|
||||||
#include <Graphic3d_CView.hxx>
|
#include <Graphic3d_CView.hxx>
|
||||||
#include <Graphic3d_MapOfObject.hxx>
|
#include <Graphic3d_MapOfObject.hxx>
|
||||||
#include <Graphic3d_MapOfStructure.hxx>
|
#include <Graphic3d_MapOfStructure.hxx>
|
||||||
@ -66,31 +65,8 @@ public:
|
|||||||
//! Deletes the manager <me>.
|
//! Deletes the manager <me>.
|
||||||
Standard_EXPORT ~Graphic3d_StructureManager();
|
Standard_EXPORT ~Graphic3d_StructureManager();
|
||||||
|
|
||||||
//! Modifies the screen update mode.
|
//! Invalidates bounding box of specified ZLayerId.
|
||||||
//!
|
Standard_EXPORT virtual void Update (const Graphic3d_ZLayerId theLayerId = Graphic3d_ZLayerId_UNKNOWN) const;
|
||||||
//! TOU_ASAP - as soon as possible
|
|
||||||
//! TOU_WAIT - on demand (with the Update function)
|
|
||||||
//! Note : Dynamic Operations and Update Mode
|
|
||||||
//! Use SetUpdateMode to control when changes to
|
|
||||||
//! the display are made. Use one of the following
|
|
||||||
//! functions to update one or more views:
|
|
||||||
//! - Update all views of the viewer: Graphic3d_StructureManager::Update()
|
|
||||||
//! - Update one view of the viewer: Graphic3d_View::Update()
|
|
||||||
//! Use one of the following functions to update the entire display:
|
|
||||||
//! - Redraw all structures in all views: Graphic3d_StructureManager::Redraw()
|
|
||||||
//! - Redraw all structures in one view: Graphic3d_View::Redraw()
|
|
||||||
void SetUpdateMode (const Aspect_TypeOfUpdate theType) { myUpdateMode = theType; }
|
|
||||||
|
|
||||||
//! Returns the screen update mode.
|
|
||||||
//!
|
|
||||||
//! TOU_ASAP as soon as possible
|
|
||||||
//! TOU_WAIT on demand (Update)
|
|
||||||
Aspect_TypeOfUpdate UpdateMode() const { return myUpdateMode; }
|
|
||||||
|
|
||||||
//! Updates screen in function of modifications of the structures
|
|
||||||
//! and invalidates bounding box of specified ZLayerId.
|
|
||||||
Standard_EXPORT virtual void Update (const Aspect_TypeOfUpdate theMode = Aspect_TOU_ASAP,
|
|
||||||
const Graphic3d_ZLayerId theLayerId = Graphic3d_ZLayerId_UNKNOWN) const;
|
|
||||||
|
|
||||||
//! Deletes and erases the 3D structure manager.
|
//! Deletes and erases the 3D structure manager.
|
||||||
Standard_EXPORT virtual void Remove();
|
Standard_EXPORT virtual void Remove();
|
||||||
@ -193,7 +169,6 @@ protected:
|
|||||||
protected:
|
protected:
|
||||||
|
|
||||||
Aspect_GenId myViewGenId;
|
Aspect_GenId myViewGenId;
|
||||||
Aspect_TypeOfUpdate myUpdateMode;
|
|
||||||
Graphic3d_MapOfStructure myDisplayedStructure;
|
Graphic3d_MapOfStructure myDisplayedStructure;
|
||||||
Graphic3d_MapOfStructure myHighlightedStructure;
|
Graphic3d_MapOfStructure myHighlightedStructure;
|
||||||
Graphic3d_MapOfObject myRegisteredObjects;
|
Graphic3d_MapOfObject myRegisteredObjects;
|
||||||
|
@ -799,8 +799,8 @@ void OpenGl_View::changeZLayer (const Handle(Graphic3d_CStructure)& theStructure
|
|||||||
const Graphic3d_ZLayerId anOldLayer = theStructure->ZLayer();
|
const Graphic3d_ZLayerId anOldLayer = theStructure->ZLayer();
|
||||||
const OpenGl_Structure* aStruct = reinterpret_cast<const OpenGl_Structure*> (theStructure.operator->());
|
const OpenGl_Structure* aStruct = reinterpret_cast<const OpenGl_Structure*> (theStructure.operator->());
|
||||||
myZLayers.ChangeLayer (aStruct, anOldLayer, theNewLayerId);
|
myZLayers.ChangeLayer (aStruct, anOldLayer, theNewLayerId);
|
||||||
Update (Aspect_TOU_WAIT, anOldLayer);
|
Update (anOldLayer);
|
||||||
Update (Aspect_TOU_WAIT, theNewLayerId);
|
Update (theNewLayerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
@ -35,7 +35,6 @@ V3d_TypeOfPickCamera.hxx
|
|||||||
V3d_TypeOfPickLight.hxx
|
V3d_TypeOfPickLight.hxx
|
||||||
V3d_TypeOfRepresentation.hxx
|
V3d_TypeOfRepresentation.hxx
|
||||||
V3d_TypeOfShadingModel.hxx
|
V3d_TypeOfShadingModel.hxx
|
||||||
V3d_TypeOfUpdate.hxx
|
|
||||||
V3d_TypeOfView.hxx
|
V3d_TypeOfView.hxx
|
||||||
V3d_TypeOfVisualization.hxx
|
V3d_TypeOfVisualization.hxx
|
||||||
V3d_UnMapped.hxx
|
V3d_UnMapped.hxx
|
||||||
|
@ -274,7 +274,6 @@ void V3d_DirectionalLight::Display (const Handle(V3d_View)& theView,
|
|||||||
Standard_Real DXRef,DYRef,DZRef,DXini,DYini,DZini;
|
Standard_Real DXRef,DYRef,DZRef,DXini,DYini,DZini;
|
||||||
Standard_Real R1,G1,B1;
|
Standard_Real R1,G1,B1;
|
||||||
V3d_TypeOfRepresentation Pres;
|
V3d_TypeOfRepresentation Pres;
|
||||||
V3d_TypeOfUpdate UpdSov;
|
|
||||||
|
|
||||||
// Creation of a structure of markable elements (position of the
|
// Creation of a structure of markable elements (position of the
|
||||||
// light, and the domain of lighting represented by a circle)
|
// light, and the domain of lighting represented by a circle)
|
||||||
@ -283,8 +282,6 @@ void V3d_DirectionalLight::Display (const Handle(V3d_View)& theView,
|
|||||||
|
|
||||||
Pres = theTPres;
|
Pres = theTPres;
|
||||||
Handle(V3d_Viewer) TheViewer = theView->Viewer();
|
Handle(V3d_Viewer) TheViewer = theView->Viewer();
|
||||||
UpdSov = TheViewer->UpdateMode();
|
|
||||||
TheViewer->SetUpdateMode(V3d_WAIT);
|
|
||||||
if (!myGraphicStructure.IsNull()) {
|
if (!myGraphicStructure.IsNull()) {
|
||||||
myGraphicStructure->Disconnect(myGraphicStructure1);
|
myGraphicStructure->Disconnect(myGraphicStructure1);
|
||||||
myGraphicStructure->Clear();
|
myGraphicStructure->Clear();
|
||||||
@ -369,7 +366,6 @@ void V3d_DirectionalLight::Display (const Handle(V3d_View)& theView,
|
|||||||
// cout << "MyGraphicStructure exploration \n" << flush; MyGraphicStructure->Exploration();
|
// cout << "MyGraphicStructure exploration \n" << flush; MyGraphicStructure->Exploration();
|
||||||
myTypeOfRepresentation = Pres;
|
myTypeOfRepresentation = Pres;
|
||||||
myGraphicStructure->Display();
|
myGraphicStructure->Display();
|
||||||
TheViewer->SetUpdateMode(UpdSov);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
|
@ -171,7 +171,6 @@ void V3d_PositionLight::Display (const Handle(V3d_View)& theView, const V3d_Type
|
|||||||
Standard_Real DXRef,DYRef,DZRef,DXini,DYini,DZini;
|
Standard_Real DXRef,DYRef,DZRef,DXini,DYini,DZini;
|
||||||
Standard_Real R1,G1,B1;
|
Standard_Real R1,G1,B1;
|
||||||
V3d_TypeOfRepresentation Pres;
|
V3d_TypeOfRepresentation Pres;
|
||||||
V3d_TypeOfUpdate UpdSov;
|
|
||||||
|
|
||||||
// Creation of a structure of markable elements (position of the
|
// Creation of a structure of markable elements (position of the
|
||||||
// light, and the domain of lighting represented by a circle)
|
// light, and the domain of lighting represented by a circle)
|
||||||
@ -180,8 +179,6 @@ void V3d_PositionLight::Display (const Handle(V3d_View)& theView, const V3d_Type
|
|||||||
|
|
||||||
Pres = theTPres;
|
Pres = theTPres;
|
||||||
Handle(V3d_Viewer) TheViewer = theView->Viewer();
|
Handle(V3d_Viewer) TheViewer = theView->Viewer();
|
||||||
UpdSov = TheViewer->UpdateMode();
|
|
||||||
TheViewer->SetUpdateMode(V3d_WAIT);
|
|
||||||
if (!myGraphicStructure.IsNull()) {
|
if (!myGraphicStructure.IsNull()) {
|
||||||
myGraphicStructure->Disconnect(myGraphicStructure1);
|
myGraphicStructure->Disconnect(myGraphicStructure1);
|
||||||
myGraphicStructure->Clear();
|
myGraphicStructure->Clear();
|
||||||
@ -289,7 +286,6 @@ void V3d_PositionLight::Display (const Handle(V3d_View)& theView, const V3d_Type
|
|||||||
myGraphicStructure->Connect(myGraphicStructure1,Graphic3d_TOC_DESCENDANT);
|
myGraphicStructure->Connect(myGraphicStructure1,Graphic3d_TOC_DESCENDANT);
|
||||||
myTypeOfRepresentation = Pres;
|
myTypeOfRepresentation = Pres;
|
||||||
myGraphicStructure->Display();
|
myGraphicStructure->Display();
|
||||||
TheViewer->SetUpdateMode(UpdSov);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
|
@ -233,7 +233,6 @@ void V3d_PositionalLight::Display (const Handle(V3d_View)& theView,
|
|||||||
Standard_Real DXRef,DYRef,DZRef,DXini,DYini,DZini;
|
Standard_Real DXRef,DYRef,DZRef,DXini,DYini,DZini;
|
||||||
Standard_Real R1,G1,B1;
|
Standard_Real R1,G1,B1;
|
||||||
V3d_TypeOfRepresentation Pres;
|
V3d_TypeOfRepresentation Pres;
|
||||||
V3d_TypeOfUpdate UpdSov;
|
|
||||||
|
|
||||||
// Creation of a structure slight of markable elements (position of the
|
// Creation of a structure slight of markable elements (position of the
|
||||||
// light, and the domain of lighting represented by a circle)
|
// light, and the domain of lighting represented by a circle)
|
||||||
@ -242,8 +241,6 @@ void V3d_PositionalLight::Display (const Handle(V3d_View)& theView,
|
|||||||
|
|
||||||
Pres = theRepresentation;
|
Pres = theRepresentation;
|
||||||
Handle(V3d_Viewer) TheViewer = theView->Viewer();
|
Handle(V3d_Viewer) TheViewer = theView->Viewer();
|
||||||
UpdSov = TheViewer->UpdateMode();
|
|
||||||
TheViewer->SetUpdateMode(V3d_WAIT);
|
|
||||||
if (!myGraphicStructure.IsNull()) {
|
if (!myGraphicStructure.IsNull()) {
|
||||||
myGraphicStructure->Disconnect(myGraphicStructure1);
|
myGraphicStructure->Disconnect(myGraphicStructure1);
|
||||||
myGraphicStructure->Clear();
|
myGraphicStructure->Clear();
|
||||||
@ -347,5 +344,4 @@ void V3d_PositionalLight::Display (const Handle(V3d_View)& theView,
|
|||||||
myGraphicStructure->Connect(myGraphicStructure1,Graphic3d_TOC_DESCENDANT);
|
myGraphicStructure->Connect(myGraphicStructure1,Graphic3d_TOC_DESCENDANT);
|
||||||
myTypeOfRepresentation = Pres;
|
myTypeOfRepresentation = Pres;
|
||||||
myGraphicStructure->Display();
|
myGraphicStructure->Display();
|
||||||
TheViewer->SetUpdateMode(UpdSov);
|
|
||||||
}
|
}
|
||||||
|
@ -271,7 +271,6 @@ void V3d_SpotLight::Display (const Handle(V3d_View)& theView,
|
|||||||
Standard_Real DXRef,DYRef,DZRef,DXini,DYini,DZini;
|
Standard_Real DXRef,DYRef,DZRef,DXini,DYini,DZini;
|
||||||
Standard_Real R1,G1,B1;
|
Standard_Real R1,G1,B1;
|
||||||
V3d_TypeOfRepresentation Pres;
|
V3d_TypeOfRepresentation Pres;
|
||||||
V3d_TypeOfUpdate UpdSov;
|
|
||||||
|
|
||||||
// Creation of a structure slight of markable elements (position of the
|
// Creation of a structure slight of markable elements (position of the
|
||||||
// light, and the domain of lighting represented by a circle)
|
// light, and the domain of lighting represented by a circle)
|
||||||
@ -280,8 +279,6 @@ void V3d_SpotLight::Display (const Handle(V3d_View)& theView,
|
|||||||
|
|
||||||
Pres = theTPres;
|
Pres = theTPres;
|
||||||
Handle(V3d_Viewer) TheViewer = theView->Viewer();
|
Handle(V3d_Viewer) TheViewer = theView->Viewer();
|
||||||
UpdSov = TheViewer->UpdateMode();
|
|
||||||
TheViewer->SetUpdateMode(V3d_WAIT);
|
|
||||||
if (!myGraphicStructure.IsNull()) {
|
if (!myGraphicStructure.IsNull()) {
|
||||||
myGraphicStructure->Disconnect(myGraphicStructure1);
|
myGraphicStructure->Disconnect(myGraphicStructure1);
|
||||||
myGraphicStructure->Clear();
|
myGraphicStructure->Clear();
|
||||||
@ -385,5 +382,4 @@ void V3d_SpotLight::Display (const Handle(V3d_View)& theView,
|
|||||||
myGraphicStructure->Connect(myGraphicStructure1,Graphic3d_TOC_DESCENDANT);
|
myGraphicStructure->Connect(myGraphicStructure1,Graphic3d_TOC_DESCENDANT);
|
||||||
myTypeOfRepresentation = Pres;
|
myTypeOfRepresentation = Pres;
|
||||||
myGraphicStructure->Display();
|
myGraphicStructure->Display();
|
||||||
TheViewer->SetUpdateMode(UpdSov);
|
|
||||||
}
|
}
|
||||||
|
@ -1,29 +0,0 @@
|
|||||||
// Created on: 1992-11-13
|
|
||||||
// Created by: GG
|
|
||||||
// Copyright (c) 1992-1999 Matra Datavision
|
|
||||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
|
||||||
//
|
|
||||||
// This file is part of Open CASCADE Technology software library.
|
|
||||||
//
|
|
||||||
// This library is free software; you can redistribute it and/or modify it under
|
|
||||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
|
||||||
// by the Free Software Foundation, with special exception defined in the file
|
|
||||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
|
||||||
// distribution for complete text of the license and disclaimer of any warranty.
|
|
||||||
//
|
|
||||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
|
||||||
// commercial license or contractual agreement.
|
|
||||||
|
|
||||||
#ifndef _V3d_TypeOfUpdate_HeaderFile
|
|
||||||
#define _V3d_TypeOfUpdate_HeaderFile
|
|
||||||
|
|
||||||
//! Determines the type of update of the view
|
|
||||||
//! - V3d_ASAP: as soon as possible. The view is updated immediately after a modification.
|
|
||||||
//! - V3d_WAIT: deferred. The view is updated when the Update function is called.
|
|
||||||
enum V3d_TypeOfUpdate
|
|
||||||
{
|
|
||||||
V3d_ASAP,
|
|
||||||
V3d_WAIT
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // _V3d_TypeOfUpdate_HeaderFile
|
|
@ -218,7 +218,9 @@ void V3d_View::Update() const
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
myView->Update (Aspect_TOU_ASAP);
|
myView->Update();
|
||||||
|
myView->Compute();
|
||||||
|
myView->Redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
@ -70,7 +70,6 @@ V3d_Viewer::V3d_Viewer (const Handle(Graphic3d_GraphicDriver)& theDriver,
|
|||||||
const Quantity_NameOfColor theViewBackground,
|
const Quantity_NameOfColor theViewBackground,
|
||||||
const V3d_TypeOfVisualization theVisualization,
|
const V3d_TypeOfVisualization theVisualization,
|
||||||
const V3d_TypeOfShadingModel theShadingModel,
|
const V3d_TypeOfShadingModel theShadingModel,
|
||||||
const V3d_TypeOfUpdate theUpdateMode,
|
|
||||||
const Standard_Boolean theComputedMode,
|
const Standard_Boolean theComputedMode,
|
||||||
const Standard_Boolean theDefaultComputedMode)
|
const Standard_Boolean theDefaultComputedMode)
|
||||||
: myDriver (theDriver),
|
: myDriver (theDriver),
|
||||||
@ -94,7 +93,6 @@ V3d_Viewer::V3d_Viewer (const Handle(Graphic3d_GraphicDriver)& theDriver,
|
|||||||
myRGrid = new V3d_RectangularGrid (this, Quantity_Color (Quantity_NOC_GRAY50), Quantity_Color (Quantity_NOC_GRAY70));
|
myRGrid = new V3d_RectangularGrid (this, Quantity_Color (Quantity_NOC_GRAY50), Quantity_Color (Quantity_NOC_GRAY70));
|
||||||
myCGrid = new V3d_CircularGrid (this, Quantity_Color (Quantity_NOC_GRAY50), Quantity_Color (Quantity_NOC_GRAY70));
|
myCGrid = new V3d_CircularGrid (this, Quantity_Color (Quantity_NOC_GRAY50), Quantity_Color (Quantity_NOC_GRAY70));
|
||||||
SetDefaultViewSize (theViewSize);
|
SetDefaultViewSize (theViewSize);
|
||||||
SetUpdateMode (theUpdateMode);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========================================================================
|
// ========================================================================
|
||||||
@ -237,24 +235,6 @@ void V3d_Viewer::SetDefaultViewSize (const Standard_Real theSize)
|
|||||||
myViewSize = theSize;
|
myViewSize = theSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========================================================================
|
|
||||||
// function : SetUpdateMode
|
|
||||||
// purpose :
|
|
||||||
// ========================================================================
|
|
||||||
void V3d_Viewer::SetUpdateMode (const V3d_TypeOfUpdate theMode)
|
|
||||||
{
|
|
||||||
myStructureManager->SetUpdateMode (static_cast<Aspect_TypeOfUpdate> (theMode));
|
|
||||||
}
|
|
||||||
|
|
||||||
// ========================================================================
|
|
||||||
// function : UpdateMode
|
|
||||||
// purpose :
|
|
||||||
// ========================================================================
|
|
||||||
V3d_TypeOfUpdate V3d_Viewer::UpdateMode() const
|
|
||||||
{
|
|
||||||
return static_cast<V3d_TypeOfUpdate> (myStructureManager->UpdateMode());
|
|
||||||
}
|
|
||||||
|
|
||||||
// ========================================================================
|
// ========================================================================
|
||||||
// function : IfMoreViews
|
// function : IfMoreViews
|
||||||
// purpose :
|
// purpose :
|
||||||
|
@ -47,7 +47,6 @@
|
|||||||
#include <V3d_ListOfView.hxx>
|
#include <V3d_ListOfView.hxx>
|
||||||
#include <V3d_TypeOfOrientation.hxx>
|
#include <V3d_TypeOfOrientation.hxx>
|
||||||
#include <V3d_TypeOfShadingModel.hxx>
|
#include <V3d_TypeOfShadingModel.hxx>
|
||||||
#include <V3d_TypeOfUpdate.hxx>
|
|
||||||
#include <V3d_TypeOfView.hxx>
|
#include <V3d_TypeOfView.hxx>
|
||||||
#include <V3d_TypeOfVisualization.hxx>
|
#include <V3d_TypeOfVisualization.hxx>
|
||||||
|
|
||||||
@ -194,15 +193,6 @@ public:
|
|||||||
//! Gives the default type of SHADING.
|
//! Gives the default type of SHADING.
|
||||||
void SetDefaultShadingModel (const V3d_TypeOfShadingModel theType) { myShadingModel = theType; }
|
void SetDefaultShadingModel (const V3d_TypeOfShadingModel theType) { myShadingModel = theType; }
|
||||||
|
|
||||||
//! Returns the regeneration mode of views in the viewer.
|
|
||||||
Standard_EXPORT V3d_TypeOfUpdate UpdateMode() const;
|
|
||||||
|
|
||||||
//! Defines the mode of regenerating the views making
|
|
||||||
//! up the viewer. This can be immediate <ASAP> or
|
|
||||||
//! deferred <WAIT>. In this latter case, the views are
|
|
||||||
//! updated when the method Update(me) is called.
|
|
||||||
Standard_EXPORT void SetUpdateMode (const V3d_TypeOfUpdate theMode);
|
|
||||||
|
|
||||||
void SetDefaultTypeOfView (const V3d_TypeOfView theType) { myDefaultTypeOfView = theType; }
|
void SetDefaultTypeOfView (const V3d_TypeOfView theType) { myDefaultTypeOfView = theType; }
|
||||||
|
|
||||||
//! Returns the default background colour object.
|
//! Returns the default background colour object.
|
||||||
@ -447,7 +437,6 @@ public: //! @name deprecated methods
|
|||||||
const Quantity_NameOfColor theViewBackground = Quantity_NOC_GRAY30,
|
const Quantity_NameOfColor theViewBackground = Quantity_NOC_GRAY30,
|
||||||
const V3d_TypeOfVisualization theVisualization = V3d_ZBUFFER,
|
const V3d_TypeOfVisualization theVisualization = V3d_ZBUFFER,
|
||||||
const V3d_TypeOfShadingModel theShadingModel = V3d_GOURAUD,
|
const V3d_TypeOfShadingModel theShadingModel = V3d_GOURAUD,
|
||||||
const V3d_TypeOfUpdate theUpdateMode = V3d_WAIT,
|
|
||||||
const Standard_Boolean theComputedMode = Standard_True,
|
const Standard_Boolean theComputedMode = Standard_True,
|
||||||
const Standard_Boolean theDefaultComputedMode = Standard_True);
|
const Standard_Boolean theDefaultComputedMode = Standard_True);
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ void VUserDrawObj::Compute(const Handle(PrsMgr_PresentationManager3d)& thePrsMgr
|
|||||||
aGroup->AddElement(anElem);
|
aGroup->AddElement(anElem);
|
||||||
|
|
||||||
// invalidate bounding box of the scene
|
// invalidate bounding box of the scene
|
||||||
thePrsMgr->StructureManager()->Update (thePrsMgr->StructureManager()->UpdateMode());
|
thePrsMgr->StructureManager()->Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VUserDrawObj::ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
|
void VUserDrawObj::ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user