Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:46

0001 // Created by: NW,JPB,CAL
0002 // Copyright (c) 1991-1999 Matra Datavision
0003 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _Graphic3d_AspectMarker3d_HeaderFile
0017 #define _Graphic3d_AspectMarker3d_HeaderFile
0018 
0019 #include <Graphic3d_Aspects.hxx>
0020 
0021 //! Creates and updates an attribute group for marker type primitives.
0022 //! This group contains the type of marker, its color, and its scale factor.
0023 class Graphic3d_AspectMarker3d : public Graphic3d_Aspects
0024 {
0025   DEFINE_STANDARD_RTTIEXT(Graphic3d_AspectMarker3d, Graphic3d_Aspects)
0026 public:
0027 
0028   //! Creates a context table for marker primitives
0029   //! defined with the following default values:
0030   //!
0031   //! Marker type : TOM_X
0032   //! Color       : YELLOW
0033   //! Scale factor: 1.0
0034   Standard_EXPORT Graphic3d_AspectMarker3d();
0035   
0036   Standard_EXPORT Graphic3d_AspectMarker3d(const Aspect_TypeOfMarker theType, const Quantity_Color& theColor, const Standard_Real theScale);
0037   
0038   //! Creates a context table for marker primitives
0039   //! defined with the specified values.
0040   Standard_EXPORT Graphic3d_AspectMarker3d(const Quantity_Color& theColor, const Standard_Integer theWidth, const Standard_Integer theHeight, const Handle(TColStd_HArray1OfByte)& theTextureBitmap);
0041   
0042   //! Creates a context table for marker primitives
0043   //! defined with the specified values.
0044   Standard_EXPORT Graphic3d_AspectMarker3d(const Handle(Image_PixMap)& theTextureImage);
0045 
0046   //! Return scale factor.
0047   Standard_ShortReal Scale() const { return myMarkerScale; }
0048 
0049   //! Modifies the scale factor.
0050   //! Marker type Aspect_TOM_POINT is not affected by the marker size scale factor.
0051   //! It is always the smallest displayable dot.
0052   //! Warning: Raises Standard_OutOfRange if the scale is a negative value.
0053   void SetScale (const Standard_ShortReal theScale)
0054   {
0055     SetMarkerScale (theScale);
0056   }
0057 
0058   //! Assign scale factor.
0059   void SetScale (const Standard_Real theScale) { SetScale ((float )theScale); }
0060 
0061   //! Return marker type.
0062   Aspect_TypeOfMarker Type() const { return myMarkerType; }
0063 
0064   //! Modifies the type of marker.
0065   void SetType (const Aspect_TypeOfMarker theType) { myMarkerType = theType; }
0066 
0067   //! Returns marker's texture size.
0068   Standard_EXPORT void GetTextureSize (Standard_Integer& theWidth, Standard_Integer& theHeight) const;
0069   
0070   //! Returns marker's image texture.
0071   //! Could be null handle if marker aspect has been initialized as default type of marker.
0072   const Handle(Graphic3d_MarkerImage)& GetMarkerImage() const { return myMarkerImage; }
0073   
0074   Standard_EXPORT void SetBitMap (const Standard_Integer theWidth, const Standard_Integer theHeight, const Handle(TColStd_HArray1OfByte)& theTexture);
0075 
0076 };
0077 
0078 DEFINE_STANDARD_HANDLE(Graphic3d_AspectMarker3d, Graphic3d_Aspects)
0079 
0080 #endif // _Graphic3d_AspectMarker3d_HeaderFile