1 // Created by: NW,JPB,CAL
2 // Copyright (c) 1991-1999 Matra Datavision
3 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #include <Graphic3d_AspectMarker3d.hxx>
18 IMPLEMENT_STANDARD_RTTIEXT(Graphic3d_AspectMarker3d, Standard_Transient)
20 // =======================================================================
21 // function : Graphic3d_AspectMarker3d
23 // =======================================================================
24 Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d()
25 : myColor (Quantity_NOC_YELLOW),
26 myType (Aspect_TOM_X),
32 // =======================================================================
33 // function : Graphic3d_AspectMarker3d
35 // =======================================================================
36 Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d (const Aspect_TypeOfMarker theType,
37 const Quantity_Color& theColor,
38 const Standard_Real theScale)
41 myScale ((float )theScale)
45 throw Aspect_AspectMarkerDefinitionError("Bad value for MarkerScale");
49 // =======================================================================
50 // function : Graphic3d_AspectMarker3d
52 // =======================================================================
53 Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d (const Quantity_Color& theColor,
54 const Standard_Integer theWidth,
55 const Standard_Integer theHeight,
56 const Handle(TColStd_HArray1OfByte)& theTextureBitMap)
57 : myMarkerImage (new Graphic3d_MarkerImage (theTextureBitMap, theWidth, theHeight)),
59 myType (Aspect_TOM_USERDEFINED),
65 // =======================================================================
66 // function : Graphic3d_AspectMarker3d
68 // =======================================================================
69 Graphic3d_AspectMarker3d::Graphic3d_AspectMarker3d (const Handle(Image_PixMap)& theTextureImage)
70 : myMarkerImage (new Graphic3d_MarkerImage (theTextureImage)),
71 myColor (Quantity_NOC_YELLOW),
72 myType (Aspect_TOM_USERDEFINED),
78 // =======================================================================
79 // function : GetTextureSize
81 // =======================================================================
82 void Graphic3d_AspectMarker3d::GetTextureSize (Standard_Integer& theWidth,
83 Standard_Integer& theHeight) const
85 if (!myMarkerImage.IsNull())
87 myMarkerImage->GetTextureSize (theWidth, theHeight);
96 // =======================================================================
97 // function : SetBitMap
99 // =======================================================================
100 void Graphic3d_AspectMarker3d::SetBitMap (const Standard_Integer theWidth,
101 const Standard_Integer theHeight,
102 const Handle(TColStd_HArray1OfByte)& theTextureBitMap)
104 myMarkerImage.Nullify();
105 myMarkerImage = new Graphic3d_MarkerImage (theTextureBitMap, theWidth, theHeight);