CFx SDK Documentation  2022 SP0
HatchPattern.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 
24 
25 
26 
27 #ifndef OD_HATCHPATTERN_H
28 #define OD_HATCHPATTERN_H
29 
30 #include "TD_PackPush.h"
31 
32 #include "Ge/GePoint2d.h"
33 #include "Ge/GeVector2d.h"
34 #include "Ge/GeDoubleArray.h"
35 
42 {
43 public:
44  double m_dLineAngle;
48 
50  m_dLineAngle(0.0)
51  {
52  }
53 
54  void transformBy(const OdGeMatrix2d& ocsXform)
55  {
56  m_basePoint.transformBy(ocsXform);
57  m_patternOffset.transformBy(ocsXform);
58 
61  pO.transformBy(ocsXform);
62  m_dLineAngle = pO.angle();
63 
65  for(pDash = m_dashes.begin(); pDash != m_dashes.end(); ++ pDash)
66  {
67  (*pDash) *= pO.length();
68  }
69  }
70  void scale(double s)
71  {
72  m_patternOffset *= s;
73  for (unsigned int j = 0; j < m_dashes.size(); ++j)
74  m_dashes[j] *= s;
75  }
76 };
77 
82 
83 #include "TD_PackPop.h"
84 
85 #endif //#ifndef OD_HATCHPATTERN_H
OdArray< OdHatchPatternLine > OdHatchPattern
Definition: HatchPattern.h:81
iterator end()
Definition: OdArray.h:772
size_type size() const
Definition: OdArray.h:893
iterator begin()
Definition: OdArray.h:751
OdGePoint2d & transformBy(const OdGeMatrix2d &xfm)
OdGeVector2d & rotateBy(double angle)
double angle() const
OdGeVector2d & transformBy(const OdGeMatrix2d &xfm)
Definition: GeVector2d.h:106
double length() const
static GE_STATIC_EXPORT const OdGeVector2d kXAxis
Definition: GeVector2d.h:66
OdGeVector2d m_patternOffset
Definition: HatchPattern.h:46
OdGePoint2d m_basePoint
Definition: HatchPattern.h:45
void scale(double s)
Definition: HatchPattern.h:70
OdGeDoubleArray m_dashes
Definition: HatchPattern.h:47
void transformBy(const OdGeMatrix2d &ocsXform)
Definition: HatchPattern.h:54