0031668: Visualization - WebGL sample doesn't work on Emscripten 1.39
[occt.git] / src / IGESGeom / IGESGeom_Flash.cxx
CommitLineData
b311480e 1// Created by: CKY / Contract Toubro-Larsen
2// Copyright (c) 1993-1999 Matra Datavision
973c2be1 3// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 4//
973c2be1 5// This file is part of Open CASCADE Technology software library.
7fd59977 6//
d5f74e42 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
973c2be1 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.
7fd59977 12//
973c2be1 13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
b311480e 15
16//--------------------------------------------------------------------
7fd59977 17//--------------------------------------------------------------------
18
7fd59977 19#include <gp_GTrsf.hxx>
42cf5bc1 20#include <gp_Pnt.hxx>
21#include <gp_Pnt2d.hxx>
22#include <gp_XY.hxx>
23#include <IGESData_IGESEntity.hxx>
24#include <IGESGeom_Flash.hxx>
25#include <Standard_OutOfRange.hxx>
26#include <Standard_Type.hxx>
7fd59977 27
92efcf78 28IMPLEMENT_STANDARD_RTTIEXT(IGESGeom_Flash,IGESData_IGESEntity)
29
b311480e 30IGESGeom_Flash::IGESGeom_Flash () { }
7fd59977 31
32
33 void IGESGeom_Flash::Init
34 (const gp_XY& aPoint,
35 const Standard_Real aDim1,
36 const Standard_Real aDim2,
37 const Standard_Real aRotation,
38 const Handle(IGESData_IGESEntity)& aReference)
39{
40 thePoint = aPoint;
41 theDim1 = aDim1;
42 theDim2 = aDim2;
43 theRotation = aRotation;
44 theReference = aReference;
45 InitTypeAndForm(125,FormNumber());
46// FormNumber : 0-4, Shape of the Flash
47}
48
49 void IGESGeom_Flash::SetFormNumber (const Standard_Integer form)
50{
9775fa61 51 if (form < 0 || form > 4) throw Standard_OutOfRange("IGESGeom_Flash : SetFormNumber");
7fd59977 52 InitTypeAndForm(125,form);
53}
54
55
56 gp_Pnt2d IGESGeom_Flash::ReferencePoint () const
57{
58 return ( gp_Pnt2d(thePoint) );
59}
60
61 gp_Pnt IGESGeom_Flash::TransformedReferencePoint () const
62{
63 gp_XYZ Point(thePoint.X(), thePoint.Y(), 0.0);
64 if (HasTransf()) Location().Transforms(Point);
65 return gp_Pnt(Point);
66}
67
68 Standard_Real IGESGeom_Flash::Dimension1 () const
69{
70 return theDim1;
71}
72
73 Standard_Real IGESGeom_Flash::Dimension2 () const
74{
75 return theDim2;
76}
77
78 Standard_Real IGESGeom_Flash::Rotation () const
79{
80 return theRotation;
81}
82
83 Standard_Boolean IGESGeom_Flash::HasReferenceEntity () const
84{
85 return (! theReference.IsNull() );
86}
87
88 Handle(IGESData_IGESEntity) IGESGeom_Flash::ReferenceEntity () const
89{
90 return theReference;
91}