Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-09 09:15:37

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   //! Creates a context table for marker primitives
0028   //! defined with the following default values:
0029   //!
0030   //! Marker type : TOM_X
0031   //! Color       : YELLOW
0032   //! Scale factor: 1.0
0033   Standard_EXPORT Graphic3d_AspectMarker3d();
0034 
0035   Standard_EXPORT Graphic3d_AspectMarker3d(const Aspect_TypeOfMarker theType,
0036                                            const Quantity_Color&     theColor,
0037                                            const Standard_Real       theScale);
0038 
0039   //! Creates a context table for marker primitives
0040   //! defined with the specified values.
0041   Standard_EXPORT Graphic3d_AspectMarker3d(const Quantity_Color&                theColor,
0042                                            const Standard_Integer               theWidth,
0043                                            const Standard_Integer               theHeight,
0044                                            const Handle(TColStd_HArray1OfByte)& theTextureBitmap);
0045 
0046   //! Creates a context table for marker primitives
0047   //! defined with the specified values.
0048   Standard_EXPORT Graphic3d_AspectMarker3d(const Handle(Image_PixMap)& theTextureImage);
0049 
0050   //! Return scale factor.
0051   Standard_ShortReal Scale() const { return myMarkerScale; }
0052 
0053   //! Modifies the scale factor.
0054   //! Marker type Aspect_TOM_POINT is not affected by the marker size scale factor.
0055   //! It is always the smallest displayable dot.
0056   //! Warning: Raises Standard_OutOfRange if the scale is a negative value.
0057   void SetScale(const Standard_ShortReal theScale) { SetMarkerScale(theScale); }
0058 
0059   //! Assign scale factor.
0060   void SetScale(const Standard_Real theScale) { SetScale((float)theScale); }
0061 
0062   //! Return marker type.
0063   Aspect_TypeOfMarker Type() const { return myMarkerType; }
0064 
0065   //! Modifies the type of marker.
0066   void SetType(const Aspect_TypeOfMarker theType) { myMarkerType = theType; }
0067 
0068   //! Returns marker's texture size.
0069   Standard_EXPORT void GetTextureSize(Standard_Integer& theWidth,
0070                                       Standard_Integer& theHeight) const;
0071 
0072   //! Returns marker's image texture.
0073   //! Could be null handle if marker aspect has been initialized as default type of marker.
0074   const Handle(Graphic3d_MarkerImage)& GetMarkerImage() const { return myMarkerImage; }
0075 
0076   Standard_EXPORT void SetBitMap(const Standard_Integer               theWidth,
0077                                  const Standard_Integer               theHeight,
0078                                  const Handle(TColStd_HArray1OfByte)& theTexture);
0079 };
0080 
0081 DEFINE_STANDARD_HANDLE(Graphic3d_AspectMarker3d, Graphic3d_Aspects)
0082 
0083 #endif // _Graphic3d_AspectMarker3d_HeaderFile