0030537: Visualization - wrapping text in font text formatter
[occt.git] / src / Graphic3d / Graphic3d_AspectMarker3d.hxx
CommitLineData
42cf5bc1 1// Created by: NW,JPB,CAL
2// Copyright (c) 1991-1999 Matra Datavision
3// Copyright (c) 1999-2014 OPEN CASCADE SAS
4//
5// This file is part of Open CASCADE Technology software library.
6//
7// This library is free software; you can redistribute it and/or modify it under
8// the terms of the GNU Lesser General Public License version 2.1 as published
9// by the Free Software Foundation, with special exception defined in the file
10// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11// distribution for complete text of the license and disclaimer of any warranty.
12//
13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
15
16#ifndef _Graphic3d_AspectMarker3d_HeaderFile
17#define _Graphic3d_AspectMarker3d_HeaderFile
18
bf5f0ca2 19#include <Graphic3d_Aspects.hxx>
42cf5bc1 20
b6472664 21//! Creates and updates an attribute group for marker type primitives.
22//! This group contains the type of marker, its color, and its scale factor.
bf5f0ca2 23class Graphic3d_AspectMarker3d : public Graphic3d_Aspects
42cf5bc1 24{
bf5f0ca2 25 DEFINE_STANDARD_RTTIEXT(Graphic3d_AspectMarker3d, Graphic3d_Aspects)
42cf5bc1 26public:
27
42cf5bc1 28 //! Creates a context table for marker primitives
29 //! defined with the following default values:
30 //!
31 //! Marker type : TOM_X
b6472664 32 //! Color : YELLOW
42cf5bc1 33 //! Scale factor: 1.0
34 Standard_EXPORT Graphic3d_AspectMarker3d();
35
36 Standard_EXPORT Graphic3d_AspectMarker3d(const Aspect_TypeOfMarker theType, const Quantity_Color& theColor, const Standard_Real theScale);
37
38 //! Creates a context table for marker primitives
39 //! defined with the specified values.
40 Standard_EXPORT Graphic3d_AspectMarker3d(const Quantity_Color& theColor, const Standard_Integer theWidth, const Standard_Integer theHeight, const Handle(TColStd_HArray1OfByte)& theTextureBitmap);
41
42 //! Creates a context table for marker primitives
43 //! defined with the specified values.
a13f2dc4 44 Standard_EXPORT Graphic3d_AspectMarker3d(const Handle(Image_PixMap)& theTextureImage);
42cf5bc1 45
b6472664 46 //! Return scale factor.
bf5f0ca2 47 Standard_ShortReal Scale() const { return myMarkerScale; }
42cf5bc1 48
b6472664 49 //! Modifies the scale factor.
50 //! Marker type Aspect_TOM_POINT is not affected by the marker size scale factor.
51 //! It is always the smallest displayable dot.
bf5f0ca2 52 //! Warning: Raises Standard_OutOfRange if the scale is a negative value.
b6472664 53 void SetScale (const Standard_ShortReal theScale)
54 {
bf5f0ca2 55 SetMarkerScale (theScale);
b6472664 56 }
42cf5bc1 57
b6472664 58 //! Assign scale factor.
59 void SetScale (const Standard_Real theScale) { SetScale ((float )theScale); }
42cf5bc1 60
b6472664 61 //! Return marker type.
bf5f0ca2 62 Aspect_TypeOfMarker Type() const { return myMarkerType; }
42cf5bc1 63
b6472664 64 //! Modifies the type of marker.
bf5f0ca2 65 void SetType (const Aspect_TypeOfMarker theType) { myMarkerType = theType; }
42cf5bc1 66
b6472664 67 //! Returns marker's texture size.
68 Standard_EXPORT void GetTextureSize (Standard_Integer& theWidth, Standard_Integer& theHeight) const;
69
70 //! Returns marker's image texture.
71 //! Could be null handle if marker aspect has been initialized as default type of marker.
72 const Handle(Graphic3d_MarkerImage)& GetMarkerImage() const { return myMarkerImage; }
73
b6472664 74 Standard_EXPORT void SetBitMap (const Standard_Integer theWidth, const Standard_Integer theHeight, const Handle(TColStd_HArray1OfByte)& theTexture);
42cf5bc1 75
b6472664 76};
42cf5bc1 77
bf5f0ca2 78DEFINE_STANDARD_HANDLE(Graphic3d_AspectMarker3d, Graphic3d_Aspects)
42cf5bc1 79
80#endif // _Graphic3d_AspectMarker3d_HeaderFile