Graphic3d_TransformPersScaledAbove.cxx
Graphic3d_TransformUtils.hxx
Graphic3d_TransModeFlags.hxx
-Graphic3d_TypeOfAnswer.hxx
Graphic3d_TypeOfBackfacingModel.hxx
Graphic3d_TypeOfBackground.hxx
Graphic3d_TypeOfConnection.hxx
Graphic3d_TypeOfTexture.hxx
Graphic3d_TypeOfTextureFilter.hxx
Graphic3d_TypeOfTextureMode.hxx
-Graphic3d_TypeOfVisualization.hxx
Graphic3d_Vec.hxx
Graphic3d_Vec2.hxx
Graphic3d_Vec3.hxx
myIsActive (Standard_False),
myIsRemoved (Standard_False),
myBackfacing (Graphic3d_TypeOfBackfacingModel_Auto),
- myVisualization (Graphic3d_TOV_WIREFRAME),
myUnitFactor (1.0)
{
myId = myStructureManager->Identification (this);
continue;
}
- // If the structure can be displayed in the new context of the view, it is displayed.
- const Graphic3d_TypeOfAnswer anAnswer = acceptDisplay (aStruct->Visual());
- if (anAnswer == Graphic3d_TOA_YES
- || anAnswer == Graphic3d_TOA_COMPUTE)
- {
- Display (aStruct);
- }
+ Display (aStruct);
}
}
continue;
}
- const Graphic3d_TypeOfAnswer anAnswer = acceptDisplay (aStruct->Visual());
- if (anAnswer == Graphic3d_TOA_YES
- || anAnswer == Graphic3d_TOA_COMPUTE)
- {
- Erase (aStruct);
- }
+ Erase (aStruct);
}
Update();
{
for (Graphic3d_ViewStructureMap::Iterator aStructIter (myStructsDisplayed); aStructIter.More(); aStructIter.Next())
{
- const Handle(Graphic3d_Structure)& aStruct = aStructIter.Key();
- const Graphic3d_TypeOfAnswer anAnswer = acceptDisplay (aStruct->Visual());
- if (anAnswer != Graphic3d_TOA_COMPUTE)
+ const Handle(Graphic3d_Structure)& aStruct = aStructIter.Key();
+ if (aStruct->Visual() != Graphic3d_TOS_COMPUTED)
{
continue;
}
for (Graphic3d_ViewStructureMap::Iterator aDispStructIter (myStructsDisplayed); aDispStructIter.More(); aDispStructIter.Next())
{
- Handle(Graphic3d_Structure) aStruct = aDispStructIter.Key();
- const Graphic3d_TypeOfAnswer anAnswer = acceptDisplay (aStruct->Visual());
- if (anAnswer != Graphic3d_TOA_COMPUTE)
+ Handle(Graphic3d_Structure) aStruct = aDispStructIter.Key();
+ if (aStruct->Visual() != Graphic3d_TOS_COMPUTED)
{
continue;
}
continue;
}
aCompStruct->SetHLRValidation (Standard_True);
-
- const Standard_Boolean toComputeWireframe = myVisualization == Graphic3d_TOV_WIREFRAME
- && aStruct->ComputeVisual() != Graphic3d_TOS_SHADING;
- const Standard_Boolean toComputeShading = myVisualization == Graphic3d_TOV_SHADING
- && aStruct->ComputeVisual() != Graphic3d_TOS_WIREFRAME;
- if (toComputeWireframe) aCompStruct->SetVisual (Graphic3d_TOS_WIREFRAME);
- if (toComputeShading ) aCompStruct->SetVisual (Graphic3d_TOS_SHADING);
+ aCompStruct->SetVisual (Graphic3d_TOS_ALL);
if (aStruct->IsHighlighted())
{
InvalidateBVHData (aLayerId);
}
- if (!ComputedMode()
+ if (!myIsInComputedMode
|| !IsActive()
|| !theStruct->IsDisplayed())
{
return;
}
- const Graphic3d_TypeOfAnswer anAnswer = acceptDisplay (theStruct->Visual());
- if (anAnswer != Graphic3d_TOA_COMPUTE)
+ if (theStruct->Visual() != Graphic3d_TOS_COMPUTED)
{
return;
}
}
aCompStruct->SetHLRValidation (Standard_True);
+ aCompStruct->SetVisual (Graphic3d_TOS_ALL);
aCompStruct->CalculateBoundBox();
- // of which type will be the computed?
- const Standard_Boolean toComputeWireframe = myVisualization == Graphic3d_TOV_WIREFRAME
- && theStruct->ComputeVisual() != Graphic3d_TOS_SHADING;
- const Standard_Boolean toComputeShading = myVisualization == Graphic3d_TOV_SHADING
- && theStruct->ComputeVisual() != Graphic3d_TOS_WIREFRAME;
- if (toComputeWireframe)
- {
- aCompStruct->SetVisual (Graphic3d_TOS_WIREFRAME);
- }
- else if (toComputeShading)
- {
- aCompStruct->SetVisual (Graphic3d_TOS_SHADING);
- }
-
if (theStruct->IsHighlighted())
{
aCompStruct->Highlight (theStruct->HighlightStyle(), Standard_False);
return aResult;
}
-// =======================================================================
-// function : acceptDisplay
-// purpose :
-// =======================================================================
-Graphic3d_TypeOfAnswer Graphic3d_CView::acceptDisplay (const Graphic3d_TypeOfStructure theStructType) const
-{
- switch (theStructType)
- {
- case Graphic3d_TOS_ALL:
- {
- return Graphic3d_TOA_YES; // The structure accepts any type of view
- }
- case Graphic3d_TOS_SHADING:
- {
- return myVisualization == Graphic3d_TOV_SHADING
- ? Graphic3d_TOA_YES
- : Graphic3d_TOA_NO;
- }
- case Graphic3d_TOS_WIREFRAME:
- {
- return myVisualization == Graphic3d_TOV_WIREFRAME
- ? Graphic3d_TOA_YES
- : Graphic3d_TOA_NO;
- }
- case Graphic3d_TOS_COMPUTED:
- {
- return (myVisualization == Graphic3d_TOV_SHADING || myVisualization == Graphic3d_TOV_WIREFRAME)
- ? Graphic3d_TOA_COMPUTE
- : Graphic3d_TOA_NO;
- }
- }
- return Graphic3d_TOA_NO;
-}
-
// =======================================================================
// function : Compute
// purpose :
aStructIter.Value()->SetHLRValidation (Standard_False);
}
- if (!ComputedMode())
+ if (!myIsInComputedMode)
{
return;
}
NCollection_Sequence<Handle(Graphic3d_Structure)> aStructsSeq;
for (Graphic3d_ViewStructureMap::Iterator aStructIter (myStructsDisplayed); aStructIter.More(); aStructIter.Next())
{
- const Graphic3d_TypeOfAnswer anAnswer = acceptDisplay (aStructIter.Key()->Visual());
- if (anAnswer == Graphic3d_TOA_COMPUTE)
+ const Handle(Graphic3d_Structure)& aStruct = aStructIter.Key();
+ if (aStruct->Visual() == Graphic3d_TOS_COMPUTED)
{
- aStructsSeq.Append (aStructIter.Key()); // if the structure was calculated, it is recalculated
+ aStructsSeq.Append (aStruct); // if the structure was calculated, it is recalculated
}
}
anIndex = 0;
}
- Graphic3d_TypeOfAnswer anAnswer = acceptDisplay (theStructure->Visual());
- if (anAnswer == Graphic3d_TOA_NO)
- {
- return;
- }
-
- if (!ComputedMode())
- {
- anAnswer = Graphic3d_TOA_YES;
- }
-
const Standard_Integer anOldExtent = myStructsDisplayed.Extent();
- if (anAnswer == Graphic3d_TOA_YES)
+ if (theStructure->Visual() != Graphic3d_TOS_COMPUTED
+ || !myIsInComputedMode)
{
const Standard_Integer aPrsIndex = myStructsDisplayed.Add (theStructure, Handle(Graphic3d_Structure)());
if (aPrsIndex <= anOldExtent)
Update (theStructure->GetZLayer());
return;
}
- else if (anAnswer != Graphic3d_TOA_COMPUTE)
- {
- return;
- }
if (anIndex != 0)
{
return;
}
aStruct->SetHLRValidation (Standard_True);
+ aStruct->SetVisual (Graphic3d_TOS_ALL);
// TOCOMPUTE and COMPUTED associated to sequences are added
myStructsToCompute.Append (theStructure);
myStructsComputed .Remove (anIndex);
}
- // Of which type will be the computed?
- const Standard_Boolean toComputeWireframe = myVisualization == Graphic3d_TOV_WIREFRAME
- && theStructure->ComputeVisual() != Graphic3d_TOS_SHADING;
- const Standard_Boolean toComputeShading = myVisualization == Graphic3d_TOV_SHADING
- && theStructure->ComputeVisual() != Graphic3d_TOS_WIREFRAME;
- if (!toComputeShading && !toComputeWireframe)
- {
- anAnswer = Graphic3d_TOA_NO;
- }
- else
- {
- aStruct->SetVisual (toComputeWireframe ? Graphic3d_TOS_WIREFRAME : Graphic3d_TOS_SHADING);
- anAnswer = acceptDisplay (aStruct->Visual());
- }
-
if (theStructure->IsHighlighted())
{
aStruct->Highlight (theStructure->HighlightStyle(), Standard_False);
}
- // It is displayed only if the calculated structure
- // has a proper type corresponding to the one of the view.
- if (anAnswer == Graphic3d_TOA_NO)
- {
- return;
- }
-
const Standard_Integer aPrsIndex = myStructsDisplayed.Add (theStructure, Handle(Graphic3d_Structure)());
displayStructure (aStruct->CStructure(), theStructure->DisplayPriority());
return;
}
- const Graphic3d_TypeOfAnswer anAnswer = myIsInComputedMode ? acceptDisplay (theStructure->Visual()) : Graphic3d_TOA_YES;
- if (anAnswer != Graphic3d_TOA_COMPUTE)
+ const bool isComputedStruct = theStructure->Visual() == Graphic3d_TOS_COMPUTED
+ && myIsInComputedMode;
+ if (!isComputedStruct)
{
eraseStructure (theStructure->CStructure());
}
const Standard_Integer anIndex = !myStructsToCompute.IsEmpty() ? IsComputed (theStructure) : 0;
if (anIndex != 0)
{
- if (anAnswer == Graphic3d_TOA_COMPUTE
- && myIsInComputedMode)
+ if (isComputedStruct)
{
const Handle(Graphic3d_Structure)& aCompStruct = myStructsComputed.ChangeValue (anIndex);
eraseStructure (aCompStruct->CStructure());
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsInComputedMode)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsActive)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsRemoved)
-
- OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myVisualization)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myBackXRCamera.get())
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myBaseXRCamera.get())
#include <Graphic3d_Structure.hxx>
#include <Graphic3d_Texture2Dmanual.hxx>
#include <Graphic3d_TextureEnv.hxx>
-#include <Graphic3d_TypeOfAnswer.hxx>
#include <Graphic3d_TypeOfBackfacingModel.hxx>
#include <Graphic3d_TypeOfBackground.hxx>
#include <Graphic3d_TypeOfShadingModel.hxx>
-#include <Graphic3d_TypeOfVisualization.hxx>
#include <Graphic3d_Vec3.hxx>
#include <Graphic3d_ZLayerId.hxx>
#include <Graphic3d_ZLayerSettings.hxx>
//! Sets backfacing model for the view.
void SetBackfacingModel (const Graphic3d_TypeOfBackfacingModel theModel) { myBackfacing = theModel; }
- //! Returns visualization type of the view.
- Graphic3d_TypeOfVisualization VisualizationType() const { return myVisualization; }
-
- //! Sets visualization type of the view.
- void SetVisualizationType (const Graphic3d_TypeOfVisualization theType) { myVisualization = theType; }
-
//! Switches computed HLR mode in the view
Standard_EXPORT void SetComputedMode (const Standard_Boolean theMode);
private:
- //! Is it possible to display the structure in the view?
- Standard_EXPORT Graphic3d_TypeOfAnswer acceptDisplay (const Graphic3d_TypeOfStructure theStructType) const;
-
//! Clears the structure in this view.
Standard_EXPORT void Clear (Graphic3d_Structure* theStructure,
const Standard_Boolean theWithDestruction);
Standard_Boolean myIsActive;
Standard_Boolean myIsRemoved;
Graphic3d_TypeOfBackfacingModel myBackfacing;
- Graphic3d_TypeOfVisualization myVisualization;
Handle(Aspect_XRSession) myXRSession;
Handle(Graphic3d_Camera) myBackXRCamera; //!< camera projection parameters to restore after closing XR session (FOV, aspect and similar)
const Handle(Graphic3d_Structure)& theLinkPrs)
: myStructureManager(theManager.get()),
myOwner (NULL),
- myVisual (Graphic3d_TOS_ALL),
- myComputeVisual (Graphic3d_TOS_ALL)
+ myVisual (Graphic3d_TOS_ALL)
{
if (!theLinkPrs.IsNull())
{
{
myVisual = theLinkPrs->myVisual;
}
- myComputeVisual = theLinkPrs->myComputeVisual;
myCStructure = theLinkPrs->myCStructure->ShadowLink (theManager);
}
else
if (!myCStructure->stick)
{
myVisual = theVisual;
- SetComputeVisual (theVisual);
}
else
{
erase();
myVisual = theVisual;
- SetComputeVisual (theVisual);
Display();
}
}
OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myOwner)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myVisual)
- OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myComputeVisual)
}
&& myCStructure->IsMutable;
}
- Graphic3d_TypeOfStructure ComputeVisual() const { return myComputeVisual; }
-
//! Clears the structure <me>.
Standard_EXPORT void GraphicClear (const Standard_Boolean WithDestruction);
Standard_EXPORT void Remove (Graphic3d_Structure* thePtr,
const Graphic3d_TypeOfConnection theType);
- void SetComputeVisual (const Graphic3d_TypeOfStructure theVisual)
- {
- // The ComputeVisual is saved only if the structure is declared TOS_ALL, TOS_WIREFRAME or TOS_SHADING.
- // This declaration permits to calculate proper representation of the structure calculated by Compute instead of passage to TOS_COMPUTED.
- if (theVisual != Graphic3d_TOS_COMPUTED)
- {
- myComputeVisual = theVisual;
- }
- }
-
//! Transforms theX, theY, theZ with the transformation theTrsf.
Standard_EXPORT static void Transforms (const gp_Trsf& theTrsf,
const Standard_Real theX, const Standard_Real theY, const Standard_Real theZ,
NCollection_IndexedMap<Graphic3d_Structure*> myDescendants;
Standard_Address myOwner;
Graphic3d_TypeOfStructure myVisual;
- Graphic3d_TypeOfStructure myComputeVisual;
};
+++ /dev/null
-// Created on: 1991-10-07
-// 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 _Graphic3d_TypeOfAnswer_HeaderFile
-#define _Graphic3d_TypeOfAnswer_HeaderFile
-
-//! The answer of the method AcceptDisplay
-//! AcceptDisplay means is it possible to display the
-//! specified structure in the specified view ?
-//! TOA_YES yes
-//! TOA_NO no
-//! TOA_COMPUTE yes but we have to compute the representation
-enum Graphic3d_TypeOfAnswer
-{
- Graphic3d_TOA_YES,
- Graphic3d_TOA_NO,
- Graphic3d_TOA_COMPUTE
-};
-
-#endif // _Graphic3d_TypeOfAnswer_HeaderFile
//! in wireframe, shadow mode, or both.
enum Graphic3d_TypeOfStructure
{
-Graphic3d_TOS_WIREFRAME,
-Graphic3d_TOS_SHADING,
Graphic3d_TOS_COMPUTED,
Graphic3d_TOS_ALL
};
+++ /dev/null
-// Created on: 1991-10-07
-// 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 _Graphic3d_TypeOfVisualization_HeaderFile
-#define _Graphic3d_TypeOfVisualization_HeaderFile
-
-//! Modes of visualisation of objects in a view
-//!
-//! TOV_WIREFRAME wireframe visualisation
-//! TOV_SHADING shaded visualisation
-enum Graphic3d_TypeOfVisualization
-{
- Graphic3d_TOV_WIREFRAME,
- Graphic3d_TOV_SHADING
-};
-
-#endif // _Graphic3d_TypeOfVisualization_HeaderFile
SetBackFacingModel (V3d_TOBM_AUTOMATIC);
SetCamera (aCamera);
SetAxis (0.,0.,0.,1.,1.,1.);
- SetVisualization (theViewer->DefaultVisualization());
SetTwist (0.);
SetAt (0.,0.,0.);
SetProj (theViewer->DefaultViewProj());
}
}
-//=============================================================================
-//function : SetVisualization
-//purpose :
-//=============================================================================
-void V3d_View::SetVisualization (const V3d_TypeOfVisualization theType)
-{
- myView->SetVisualizationType (static_cast <Graphic3d_TypeOfVisualization> (theType));
-
- if (myImmediateUpdate)
- {
- Redraw();
- }
-}
-
//=============================================================================
//function : SetFront
//purpose :
return myView->TextureEnv();
}
-//=============================================================================
-//function : Visualization
-//purpose :
-//=============================================================================
-V3d_TypeOfVisualization V3d_View::Visualization() const
-{
- return static_cast<V3d_TypeOfVisualization> (myView->VisualizationType());
-}
-
//=============================================================================
//function : IfWindow
//purpose :
public:
- //! Defines the visualization type in the view.
- Standard_EXPORT void SetVisualization (const V3d_TypeOfVisualization theType);
-
//! Activates theLight in the view.
Standard_EXPORT void SetLightOn (const Handle(V3d_Light)& theLight);
Standard_EXPORT Handle(Graphic3d_TextureEnv) TextureEnv() const;
- //! Returns the current visualisation mode.
- Standard_EXPORT V3d_TypeOfVisualization Visualization() const;
-
//! Returns a list of active lights.
const V3d_ListOfLight& ActiveLights() const { return myActiveLights; }
myBackground (Quantity_NOC_GRAY30),
myViewSize (1000.0),
myViewProj (V3d_XposYnegZpos),
- myVisualization (V3d_ZBUFFER),
myDefaultTypeOfView (V3d_ORTHOGRAPHIC),
myComputedMode (Standard_True),
myDefaultComputedMode (Standard_False),
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myViewSize)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myViewProj)
- OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myVisualization)
OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myDefaultTypeOfView)
OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myDefaultRenderingParams)
#include <V3d_ListOfView.hxx>
#include <V3d_TypeOfOrientation.hxx>
#include <V3d_TypeOfView.hxx>
-#include <V3d_TypeOfVisualization.hxx>
#include <Quantity_Color.hxx>
class Aspect_Grid;
//! Sets the default projection for creating views in the viewer.
void SetDefaultViewProj (const V3d_TypeOfOrientation theOrientation) { myViewProj = theOrientation; }
- //! Returns the default type of Visualization.
- V3d_TypeOfVisualization DefaultVisualization() const { return myVisualization; }
-
- //! Gives the default visualization mode.
- void SetDefaultVisualization (const V3d_TypeOfVisualization theType) { myVisualization = theType; }
-
//! Returns the default type of Shading; Graphic3d_TypeOfShadingModel_Phong by default.
Graphic3d_TypeOfShadingModel DefaultShadingModel() const { return myDefaultRenderingParams.ShadingModel; }
Aspect_GradientBackground myGradientBackground;
Standard_Real myViewSize;
V3d_TypeOfOrientation myViewProj;
- V3d_TypeOfVisualization myVisualization;
V3d_TypeOfView myDefaultTypeOfView;
Graphic3d_RenderingParams myDefaultRenderingParams;