mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0024776: Visualization - inherit OpenGl_View from Graphic3d_CView
Expose interface of OpenGl_View (OpenGL graphics rendering methods) to client code and collecting all high-level API methods of application views in V3d_View class. 1) Exposing interface of OpenGl_View: The OpenGl_View inherits from new class Graphic3d_CView. Graphic3d_CView is an interface class that declares abstract methods for managing displayed structures, display properties and a base layer code that implements computation and management of HLR (or more broadly speaking view-depended) structures. In new implementation it takes place of eliminated Visual3d_View. As before the instance of Graphic3d_CView is still completely managed by V3d_View classes. It can be accessed through V3d_View interface but normally this should not be required as all its methods are completely wrapped. In more details, a concrete specialization of Graphic3d_CView is created and returned by graphical driver on request. Right after creation the views is directly used for setting rendering properties and adding graphical structures to be displayed. The rendering of graphics is possible after mapping a window and activating the view. The direct setting of properties makes obsolete usage of intermediate structures with display parameter like Visual3d_ContextView and etc (the whole package of Visual3d become redundant). 2) Collecting all high-level API methods of application views in V3d package: The patch includes elimination of Visual3d layer. All of its methods that could be previously used by application are now exposed and should be accessed on the level of V3d entities. - Introduced new class Graphic3d_CView. This is a base class for render views. Made possible to specialize concrete instances of the class by graphical driver. - Moved all methods managing rendering views into interface of Graphic3d_CView. The corresponding methods were removed from interface of graphical driver. 3) Eliminated Visual3d package: - Logic of managing display of structures was put from Visual3d_ViewManager into Graphic3d_StructureManager. - Removed Visual3d_View class. Logic of managing computed structures was put into base layer of Graphi3d_CView. - Removed all intermediate structures for storing view parameters e.g. Visual3d_ContextView. All settings are kept by instances of Graphic3d_CView - Removed Visual3d_Light intermediate class. All light properties are still stored in Graphic3d_CLight structure. The structure is directly access by instance of V3d_Light classes. - Moved all needed enumerations into Graphic3d package. 4) Update package D3DHost to new changes. 5) Update code of OCCT samples to new changes.
This commit is contained in:
@@ -27,7 +27,6 @@
|
||||
#include <PrsMgr_Prs.hxx>
|
||||
#include <Quantity_Color.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Visual3d_View.hxx>
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -374,7 +373,7 @@ void PrsMgr_Presentation::Compute (const Handle(Graphic3d_DataStructureManager)&
|
||||
//=======================================================================
|
||||
Handle(Prs3d_Projector) PrsMgr_Presentation::Projector (const Handle(Graphic3d_DataStructureManager)& theProjector)
|
||||
{
|
||||
Handle(Graphic3d_Camera) aCamera (Handle(Visual3d_View)::DownCast (theProjector)->Camera());
|
||||
Handle(Graphic3d_Camera) aCamera = Handle(Graphic3d_CView)::DownCast (theProjector)->Camera();
|
||||
const gp_Dir aDir = aCamera->Direction().Reversed();
|
||||
const gp_Pnt anAt = aCamera->Center();
|
||||
const gp_Dir anUp = aCamera->Up();
|
||||
|
@@ -15,7 +15,6 @@
|
||||
|
||||
#include <Geom_Transformation.hxx>
|
||||
#include <Graphic3d_GraphicDriver.hxx>
|
||||
#include <Graphic3d_StructureManager.hxx>
|
||||
#include <Prs3d_Presentation.hxx>
|
||||
#include <Prs3d_PresentationShadow.hxx>
|
||||
#include <Prs3d_ShadingAspect.hxx>
|
||||
@@ -28,14 +27,12 @@
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TColStd_ListIteratorOfListOfTransient.hxx>
|
||||
#include <V3d_View.hxx>
|
||||
#include <Visual3d_View.hxx>
|
||||
#include <Visual3d_ViewManager.hxx>
|
||||
|
||||
// =======================================================================
|
||||
// function : PrsMgr_PresentationManager
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
PrsMgr_PresentationManager::PrsMgr_PresentationManager (const Handle(Visual3d_ViewManager)& theStructureManager)
|
||||
PrsMgr_PresentationManager::PrsMgr_PresentationManager (const Handle(Graphic3d_StructureManager)& theStructureManager)
|
||||
: myStructureManager (theStructureManager),
|
||||
myImmediateModeOn (0),
|
||||
mySelectionColor (Quantity_NOC_GRAY99)
|
||||
@@ -346,7 +343,7 @@ void PrsMgr_PresentationManager::displayImmediate (const Handle(V3d_Viewer)& the
|
||||
{
|
||||
for (theViewer->InitActiveViews(); theViewer->MoreActiveViews(); theViewer->NextActiveViews())
|
||||
{
|
||||
const Handle(Visual3d_View)& aView = theViewer->ActiveView()->View();
|
||||
const Handle(Graphic3d_CView)& aView = theViewer->ActiveView()->View();
|
||||
for (PrsMgr_ListOfPresentations::Iterator anIter (myImmediateList); anIter.More(); anIter.Next())
|
||||
{
|
||||
const Handle(Prs3d_Presentation)& aPrs = anIter.Value();
|
||||
@@ -365,7 +362,7 @@ void PrsMgr_PresentationManager::displayImmediate (const Handle(V3d_Viewer)& the
|
||||
aShadowPrs->Highlight (Aspect_TOHM_COLOR, aPrs->HighlightColor());
|
||||
myViewDependentImmediateList.Append (aShadowPrs);
|
||||
}
|
||||
// handles custom highlight presentations which were defined in overriden
|
||||
// handles custom highlight presentations which were defined in overridden
|
||||
// HilightOwnerWithColor method of a custom AIS objects and maintain its
|
||||
// visibility in different views on their own
|
||||
else if (aShadowPrs.IsNull())
|
||||
|
@@ -17,27 +17,25 @@
|
||||
#ifndef _PrsMgr_PresentationManager_HeaderFile
|
||||
#define _PrsMgr_PresentationManager_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Graphic3d_NameOfMaterial.hxx>
|
||||
#include <Graphic3d_StructureManager.hxx>
|
||||
#include <Graphic3d_ZLayerId.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <PrsMgr_ListOfPresentations.hxx>
|
||||
#include <Quantity_Color.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Quantity_NameOfColor.hxx>
|
||||
#include <Graphic3d_NameOfMaterial.hxx>
|
||||
#include <Graphic3d_ZLayerId.hxx>
|
||||
class Visual3d_ViewManager;
|
||||
class V3d_Viewer;
|
||||
class Standard_NoSuchObject;
|
||||
class PrsMgr_PresentableObject;
|
||||
class Prs3d_Presentation;
|
||||
class Geom_Transformation;
|
||||
class Graphic3d_StructureManager;
|
||||
class Prs3d_ShadingAspect;
|
||||
class PrsMgr_Presentation;
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
class Geom_Transformation;
|
||||
class Prs3d_Presentation;
|
||||
class Prs3d_ShadingAspect;
|
||||
class PrsMgr_PresentableObject;
|
||||
class PrsMgr_Presentation;
|
||||
class Standard_NoSuchObject;
|
||||
class V3d_Viewer;
|
||||
|
||||
class PrsMgr_PresentationManager;
|
||||
DEFINE_STANDARD_HANDLE(PrsMgr_PresentationManager, MMgt_TShared)
|
||||
@@ -54,7 +52,7 @@ public:
|
||||
|
||||
|
||||
//! Creates a framework to manage displays and graphic entities with the 3D view theStructureManager.
|
||||
Standard_EXPORT PrsMgr_PresentationManager(const Handle(Visual3d_ViewManager)& theStructureManager);
|
||||
Standard_EXPORT PrsMgr_PresentationManager(const Handle(Graphic3d_StructureManager)& theStructureManager);
|
||||
|
||||
//! Displays the presentation of the object in the given Presentation manager with the given mode.
|
||||
//! The mode should be enumerated by the object which inherits PresentableObject.
|
||||
@@ -175,7 +173,7 @@ protected:
|
||||
//! Removes a presentation of the presentable object thePrsObject to this framework. thePrsObject has the display mode theMode.
|
||||
Standard_EXPORT Standard_Boolean RemovePresentation (const Handle(PrsMgr_PresentableObject)& thePrsObject, const Standard_Integer theMode = 0);
|
||||
|
||||
Handle(Visual3d_ViewManager) myStructureManager;
|
||||
Handle(Graphic3d_StructureManager) myStructureManager;
|
||||
Standard_Integer myImmediateModeOn;
|
||||
PrsMgr_ListOfPresentations myImmediateList;
|
||||
PrsMgr_ListOfPresentations myViewDependentImmediateList;
|
||||
|
@@ -14,8 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Visual3d_ViewManager.hxx>
|
||||
|
||||
inline Standard_Boolean PrsMgr_PresentationManager::IsImmediateModeOn() const
|
||||
{
|
||||
return myImmediateModeOn > 0;
|
||||
|
Reference in New Issue
Block a user