X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=blobdiff_plain;f=src%2FGraphic3d%2FGraphic3d_AspectMarker3d.cxx;h=141f9b4926fd434d0ab1d26ca4de495a956cd385;hb=b647266461fb2c92d199ff6d04ed6424514cf23b;hpb=28cab3768f75ea7dc3ce95d80c9e649d147f4180 diff --git a/src/Graphic3d/Graphic3d_AspectMarker3d.cxx b/src/Graphic3d/Graphic3d_AspectMarker3d.cxx index f0b24e67c3..141f9b4926 100644 --- a/src/Graphic3d/Graphic3d_AspectMarker3d.cxx +++ b/src/Graphic3d/Graphic3d_AspectMarker3d.cxx @@ -13,23 +13,21 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. - #include -#include -#include -#include -#include -#include -IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_AspectMarker3d,Aspect_AspectMarker) +IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_AspectMarker3d, Standard_Transient) // ======================================================================= // function : Graphic3d_AspectMarker3d // purpose : // ======================================================================= Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d() -: Aspect_AspectMarker() -{} +: myColor (Quantity_NOC_YELLOW), + myType (Aspect_TOM_X), + myScale (1.0f) +{ + // +} // ======================================================================= // function : Graphic3d_AspectMarker3d @@ -38,8 +36,15 @@ Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d() Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d (const Aspect_TypeOfMarker theType, const Quantity_Color& theColor, const Standard_Real theScale) -: Aspect_AspectMarker (theColor, theType, theScale) -{} +: myColor (theColor), + myType (theType), + myScale ((float )theScale) +{ + if (theScale <= 0.0) + { + Aspect_AspectMarkerDefinitionError::Raise ("Bad value for MarkerScale"); + } +} // ======================================================================= // function : Graphic3d_AspectMarker3d @@ -49,18 +54,26 @@ Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d (const Quantity_Color& theCo const Standard_Integer theWidth, const Standard_Integer theHeight, const Handle(TColStd_HArray1OfByte)& theTextureBitMap) -: Aspect_AspectMarker (theColor, Aspect_TOM_USERDEFINED, 1.0), - myMarkerImage (new Graphic3d_MarkerImage (theTextureBitMap, theWidth, theHeight)) -{} +: myMarkerImage (new Graphic3d_MarkerImage (theTextureBitMap, theWidth, theHeight)), + myColor (theColor), + myType (Aspect_TOM_USERDEFINED), + myScale (1.0f) +{ + // +} // ======================================================================= // function : Graphic3d_AspectMarker3d // purpose : // ======================================================================= Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d (const Handle(Image_PixMap)& theTextureImage) -: Aspect_AspectMarker (Quantity_NOC_YELLOW, Aspect_TOM_USERDEFINED, 1.0), - myMarkerImage (new Graphic3d_MarkerImage (theTextureImage)) -{} +: myMarkerImage (new Graphic3d_MarkerImage (theTextureImage)), + myColor (Quantity_NOC_YELLOW), + myType (Aspect_TOM_USERDEFINED), + myScale (1.0f) +{ + // +} // ======================================================================= // function : GetTextureSize @@ -80,24 +93,6 @@ void Graphic3d_AspectMarker3d::GetTextureSize (Standard_Integer& theWidth, } } -// ======================================================================= -// function : GetMarkerImage -// purpose : -// ======================================================================= -const Handle(Graphic3d_MarkerImage)& Graphic3d_AspectMarker3d::GetMarkerImage() const -{ - return myMarkerImage; -} - -// ======================================================================= -// function : SetMarkerImage -// purpose : -// ======================================================================= -void Graphic3d_AspectMarker3d::SetMarkerImage (const Handle(Graphic3d_MarkerImage)& theImage) -{ - myMarkerImage = theImage; -} - // ======================================================================= // function : SetBitMap // purpose : @@ -109,21 +104,3 @@ void Graphic3d_AspectMarker3d::SetBitMap (const Standard_Integer theWidth, myMarkerImage.Nullify(); myMarkerImage = new Graphic3d_MarkerImage (theTextureBitMap, theWidth, theHeight); } - -// ======================================================================= -// function : SetShaderProgram -// purpose : -// ======================================================================= -void Graphic3d_AspectMarker3d::SetShaderProgram (const Handle(Graphic3d_ShaderProgram)& theProgram) -{ - MyShaderProgram = theProgram; -} - -// ======================================================================= -// function : ShaderProgram -// purpose : -// ======================================================================= -const Handle(Graphic3d_ShaderProgram)& Graphic3d_AspectMarker3d::ShaderProgram() const -{ - return MyShaderProgram; -}