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

Compare commits

..

2 Commits

Author SHA1 Message Date
nds
de110ed8b2 0030491: Visualization - OpenGl_Element inherits Standard_Transient
# moving direct objects into Handles
2019-02-22 19:56:30 +03:00
nds
40131e1f4c 0030491: Visualization - OpenGl_Element inherits Standard_Transient 2019-02-08 19:30:15 +03:00
7 changed files with 23 additions and 22 deletions

View File

@@ -207,7 +207,7 @@ void OpenGl_CappingAlgo::RenderCapping (const Handle(OpenGl_Workspace)& theWorks
}
// remember current aspect face defined in workspace
const Handle(OpenGl_AspectFace)& aFaceAsp = theWorkspace->AspectFace();
const Handle(OpenGl_AspectFace) aFaceAsp = theWorkspace->AspectFace();
// only filled primitives should be rendered
const Standard_Integer aPrevFilter = theWorkspace->RenderFilter();

View File

@@ -3165,7 +3165,7 @@ Handle(OpenGl_FrameBuffer) OpenGl_Context::SetDefaultFrameBuffer (const Handle(O
// function : SetShadingMaterial
// purpose :
// =======================================================================
void OpenGl_Context::SetShadingMaterial (const Handle(OpenGl_AspectFace)& theAspect,
void OpenGl_Context::SetShadingMaterial (Handle(OpenGl_AspectFace)& theAspect,
const Handle(Graphic3d_PresentationAttributes)& theHighlight)
{
const Handle(Graphic3d_AspectFillArea3d)& anAspect = (!theHighlight.IsNull() && !theHighlight->BasicFillAreaAspect().IsNull())
@@ -3237,7 +3237,7 @@ void OpenGl_Context::SetShadingMaterial (const Handle(OpenGl_AspectFace)& theAsp
// function : CheckIsTransparent
// purpose :
// =======================================================================
Standard_Boolean OpenGl_Context::CheckIsTransparent (const Handle(OpenGl_AspectFace)& theAspect,
Standard_Boolean OpenGl_Context::CheckIsTransparent (Handle(OpenGl_AspectFace)& theAspect,
const Handle(Graphic3d_PresentationAttributes)& theHighlight,
Standard_ShortReal& theAlphaFront,
Standard_ShortReal& theAlphaBack)

View File

@@ -696,17 +696,17 @@ public: //! @name methods to alter or retrieve current state
Standard_EXPORT Standard_Boolean BindProgram (const Handle(OpenGl_ShaderProgram)& theProgram);
//! Setup current shading material.
Standard_EXPORT void SetShadingMaterial (const Handle(OpenGl_AspectFace)& theAspect,
Standard_EXPORT void SetShadingMaterial (Handle(OpenGl_AspectFace)& theAspect,
const Handle(Graphic3d_PresentationAttributes)& theHighlight);
//! Checks if transparency is required for the given aspect and highlight style.
Standard_EXPORT static Standard_Boolean CheckIsTransparent (const Handle(OpenGl_AspectFace)& theAspect,
Standard_EXPORT static Standard_Boolean CheckIsTransparent (Handle(OpenGl_AspectFace)& theAspect,
const Handle(Graphic3d_PresentationAttributes)& theHighlight,
Standard_ShortReal& theAlphaFront,
Standard_ShortReal& theAlphaBack);
//! Checks if transparency is required for the given aspect and highlight style.
static Standard_Boolean CheckIsTransparent (const Handle(OpenGl_AspectFace)& theAspect,
static Standard_Boolean CheckIsTransparent (Handle(OpenGl_AspectFace)& theAspect,
const Handle(Graphic3d_PresentationAttributes)& theHighlight)
{
Standard_ShortReal anAlphaFront = 1.0f, anAlphaBack = 1.0f;

View File

@@ -719,15 +719,16 @@ void OpenGl_GraduatedTrihedron::SetMinMax (const OpenGl_Vec3& theMin, const Open
// =======================================================================
OpenGl_GraduatedTrihedron::Axis::Axis (const Graphic3d_AxisAspect& theAspect,
const OpenGl_Vec3& theDirection)
: Direction (theDirection),
Label (new OpenGl_Text(NCollection_String ((Standard_Utf16Char* )theAspect.Name().ToExtString()).ToCString(), theDirection, THE_LABEL_PARAMS)),
Tickmark (new OpenGl_PrimitiveArray (NULL)),
Line (new OpenGl_PrimitiveArray (NULL)),
Arrow (new OpenGl_PrimitiveArray (NULL))
: Direction (theDirection)
{
NameColor = theAspect.NameColor();
LineAspect = new OpenGl_AspectLine();
LineAspect->Aspect()->SetColor (theAspect.Color());
Label = new OpenGl_Text(NCollection_String ((Standard_Utf16Char* )theAspect.Name().ToExtString()).ToCString(), theDirection, THE_LABEL_PARAMS);
Tickmark = new OpenGl_PrimitiveArray (NULL);
Line = new OpenGl_PrimitiveArray (NULL);
Arrow = new OpenGl_PrimitiveArray (NULL);
}
// =======================================================================

View File

@@ -508,7 +508,7 @@ void OpenGl_PrimitiveArray::drawEdges (const OpenGl_Vec4& theEdgeCo
const Handle(OpenGl_AspectLine) anAspectLineOld = theWorkspace->AspectLine();
theWorkspace->SetAspectLine (theWorkspace->AspectFace()->AspectEdge());
const Handle(OpenGl_AspectLine)& anAspect = theWorkspace->ApplyAspectLine();
const Handle(OpenGl_AspectLine) anAspect = theWorkspace->ApplyAspectLine();
#if !defined(GL_ES_VERSION_2_0)
glPolygonMode (GL_FRONT_AND_BACK, GL_LINE);
@@ -593,7 +593,7 @@ void OpenGl_PrimitiveArray::drawEdges (const OpenGl_Vec4& theEdgeCo
// =======================================================================
void OpenGl_PrimitiveArray::drawMarkers (const Handle(OpenGl_Workspace)& theWorkspace) const
{
const Handle(OpenGl_AspectMarker)& anAspectMarker = theWorkspace->ApplyAspectMarker();
const Handle(OpenGl_AspectMarker) anAspectMarker = theWorkspace->ApplyAspectMarker();
const Handle(OpenGl_Context)& aCtx = theWorkspace->GetGlContext();
const GLenum aDrawMode = !aCtx->ActiveProgram().IsNull()
&& aCtx->ActiveProgram()->HasTessellationStage()
@@ -770,9 +770,9 @@ void OpenGl_PrimitiveArray::Render (const Handle(OpenGl_Workspace)& theWorkspace
return;
}
const Handle(OpenGl_AspectFace)& anAspectFace = theWorkspace->ApplyAspectFace();
const Handle(OpenGl_AspectLine)& anAspectLine = theWorkspace->ApplyAspectLine();
const Handle(OpenGl_AspectMarker)& anAspectMarker = myDrawMode == GL_POINTS
const Handle(OpenGl_AspectFace) anAspectFace = theWorkspace->ApplyAspectFace();
const Handle(OpenGl_AspectLine) anAspectLine = theWorkspace->ApplyAspectLine();
const Handle(OpenGl_AspectMarker) anAspectMarker = myDrawMode == GL_POINTS
? theWorkspace->ApplyAspectMarker()
: theWorkspace->AspectMarker();

View File

@@ -357,7 +357,7 @@ void OpenGl_Text::Render (const Handle(OpenGl_Workspace)& theWorkspace) const
{
theWorkspace->SetAspectFace (theWorkspace->FontFaceAspect());
theWorkspace->ApplyAspectFace();
const Handle(OpenGl_AspectText)& aTextAspect = theWorkspace->ApplyAspectText();
const Handle(OpenGl_AspectText) aTextAspect = theWorkspace->ApplyAspectText();
const Handle(OpenGl_Context)& aCtx = theWorkspace->GetGlContext();
const Handle(OpenGl_TextureSet) aPrevTexture = aCtx->BindTextures (Handle(OpenGl_TextureSet)());

View File

@@ -166,16 +166,16 @@ public:
const Handle(OpenGl_AspectLine)& AspectLine() const { return myAspectLineSet; }
//! Currently set face aspect (can differ from applied).
const Handle(OpenGl_AspectFace)& AspectFace() const { return myAspectFaceSet; }
const Handle(OpenGl_AspectFace) AspectFace() const { return myAspectFaceSet; }
//! Currently set marker aspect (can differ from applied).
const Handle(OpenGl_AspectMarker)& AspectMarker() const { return myAspectMarkerSet; }
//! Currently set text aspect (can differ from applied).
const Handle(OpenGl_AspectText)& AspectText() const { return myAspectTextSet; }
const Handle(OpenGl_AspectText)& AspectText() const { return myAspectTextSet; }
//! Assign new line aspect (will be applied within ApplyAspectLine()).
Standard_EXPORT void SetAspectLine (const Handle(OpenGl_AspectLine)& theAspect);
Standard_EXPORT void SetAspectLine (const Handle(OpenGl_AspectLine)& theAspect);
//! Assign new face aspect (will be applied within ApplyAspectFace()).
Standard_EXPORT void SetAspectFace (const Handle(OpenGl_AspectFace)& theAspect);
@@ -184,11 +184,11 @@ public:
Standard_EXPORT void SetAspectMarker (const Handle(OpenGl_AspectMarker)& theAspect);
//! Assign new text aspect (will be applied within ApplyAspectText()).
Standard_EXPORT void SetAspectText (const Handle(OpenGl_AspectText)& theAspect);
Standard_EXPORT void SetAspectText (const Handle(OpenGl_AspectText)& theAspect);
//! Apply line aspect.
//! @return aspect set by SetAspectLine()
const Handle(OpenGl_AspectLine)& ApplyAspectLine() { return myAspectLineSet; }
const Handle(OpenGl_AspectLine) ApplyAspectLine() { return myAspectLineSet; }
//! Apply face aspect.
//! @return aspect set by SetAspectFace()