Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:40

0001 // Created on: 1993-04-26
0002 // Created by: Jean-Louis Frenkel
0003 // Copyright (c) 1993-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _Prs3d_PointAspect_HeaderFile
0018 #define _Prs3d_PointAspect_HeaderFile
0019 
0020 #include <Prs3d_BasicAspect.hxx>
0021 #include <Graphic3d_AspectMarker3d.hxx>
0022 #include <Graphic3d_MarkerImage.hxx>
0023 
0024 //! This  class  defines  attributes for the points
0025 //! The points are drawn using markers, whose size does not depend on
0026 //! the zoom value of the views.
0027 class Prs3d_PointAspect : public Prs3d_BasicAspect
0028 {
0029   DEFINE_STANDARD_RTTIEXT(Prs3d_PointAspect, Prs3d_BasicAspect)
0030 public:
0031 
0032   Standard_EXPORT Prs3d_PointAspect(const Aspect_TypeOfMarker theType, const Quantity_Color& theColor, const Standard_Real theScale);
0033   
0034   //! Defines the user defined marker point.
0035   Standard_EXPORT Prs3d_PointAspect (const Quantity_Color& theColor,
0036                                      const Standard_Integer theWidth,
0037                                      const Standard_Integer theHeight,
0038                                      const Handle(TColStd_HArray1OfByte)& theTexture);
0039   
0040   Prs3d_PointAspect (const Handle(Graphic3d_AspectMarker3d)& theAspect) : myAspect (theAspect) {}
0041 
0042   //! defines the color to be used when drawing a point.
0043   //! Default value: Quantity_NOC_YELLOW
0044   void SetColor (const Quantity_Color& theColor) { myAspect->SetColor (theColor); }
0045 
0046   //! defines the type of representation to be used when drawing a point.
0047   //! Default value: Aspect_TOM_PLUS
0048   void SetTypeOfMarker (const Aspect_TypeOfMarker theType) { myAspect->SetType (theType); }
0049   
0050   //! defines the size of the marker used when drawing a point.
0051   //! Default value: 1.
0052   void SetScale (const Standard_Real theScale) { myAspect->SetScale (theScale); }
0053   
0054   const Handle(Graphic3d_AspectMarker3d)& Aspect() const { return myAspect; }
0055 
0056   void SetAspect (const Handle(Graphic3d_AspectMarker3d)& theAspect) { myAspect = theAspect; }
0057 
0058   //! Returns marker's texture size.
0059   void GetTextureSize (Standard_Integer& theWidth, Standard_Integer& theHeight) const { myAspect->GetTextureSize (theWidth, theHeight); }
0060   
0061   //! Returns marker's texture.
0062   const Handle(Graphic3d_MarkerImage)& GetTexture() const { return myAspect->GetMarkerImage(); }
0063 
0064   //! Dumps the content of me into the stream
0065   Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
0066 
0067 protected:
0068 
0069   Handle(Graphic3d_AspectMarker3d) myAspect;
0070 
0071 };
0072 
0073 DEFINE_STANDARD_HANDLE(Prs3d_PointAspect, Prs3d_BasicAspect)
0074 
0075 #endif // _Prs3d_PointAspect_HeaderFile