4 #include "HW2DReaderCommon.h"
8 static inline void WT2HT(
const WT_Integer32 in_x,
const WT_Integer32 in_y,
9 float & out_x,
float & out_y,
float & out_z,
12 static inline void WT2HT(
const WT_Logical_Point & in,
Point & out,
const HW2DReaderCommon * pW2DReaderCommon);
14 static inline void WT2HT (
const float in_x,
const float in_y,
15 float & out_x,
float & out_y,
float & out_z,
20 static inline void WT2HT(
const WT_Logical_Point * points,
int count,
Point * out,
HW2DReaderCommon * pW2DReaderCommon);
32 { WT2HT(xx, yy, x, y, z, pHW2DReaderCommon); }
35 { WT2HT(p.m_x, p.m_y, x, y, z, pHW2DReaderCommon); }
38 { WT2HT (xx, yy, x, y, z, pHW2DReaderCommon); }
50 Point * points()
const {
return m_pts; }
51 int count()
const {
return m_count; }
52 Point * GetPoint(
int idx) {
return &m_pts[idx]; }
55 void set(
const WT_Logical_Point * points);
56 void set(
const WT_Point_Set & in);
58 Point m_pts_static[32];
67 static inline void update_bounds(WT_Logical_Box & lhlb,
const WT_Logical_Box & rhlb)
69 if( rhlb.m_min.m_x < lhlb.m_min.m_x )
70 lhlb.m_min.m_x = rhlb.m_min.m_x;
72 if( rhlb.m_min.m_y < lhlb.m_min.m_y )
73 lhlb.m_min.m_y = rhlb.m_min.m_y;
75 if( rhlb.m_max.m_x > lhlb.m_max.m_x )
76 lhlb.m_max.m_x = rhlb.m_max.m_x;
78 if( rhlb.m_max.m_y > lhlb.m_max.m_y )
79 lhlb.m_max.m_y = rhlb.m_max.m_y;
82 static inline void update_bounds(WT_Logical_Box & lhlb,
const WT_Logical_Point & wt_point)
84 if( wt_point.m_x < lhlb.m_min.m_x )
85 lhlb.m_min.m_x = wt_point.m_x;
86 else if( wt_point.m_x > lhlb.m_max.m_x )
87 lhlb.m_max.m_x = wt_point.m_x;
89 if( wt_point.m_y < lhlb.m_min.m_y )
90 lhlb.m_min.m_y = wt_point.m_y;
91 else if( wt_point.m_y > lhlb.m_max.m_y )
92 lhlb.m_max.m_y = wt_point.m_y;
95 static inline void update_bounds(WT_Logical_Box & lhlb,
const int nPoints,
const WT_Logical_Point * pPoints)
97 for(
int i = 0; i < nPoints; i++ )
98 update_bounds(lhlb, pPoints[i]);
101 static void WT2HT(
const WT_Integer32 in_x,
const WT_Integer32 in_y,
102 float & out_x,
float & out_y,
float & out_z,
105 if(pW2DReaderCommon->m_CoordMode == HW2DReaderCommon::recentered_coords)
107 out_x = in_x - pW2DReaderCommon->m_x_extents;
108 out_y = in_y - pW2DReaderCommon->m_y_extents;
109 out_z = pW2DReaderCommon->m_z_plane;
111 else if(pW2DReaderCommon->m_CoordMode == HW2DReaderCommon::application_coords)
113 WT_Point3D pt_in((
double)in_x, (
double)in_y);
114 WT_Point3D pt_out = pW2DReaderCommon->m_pWhipUnits->transform_from_DWF_to_application(pt_in);
117 out_z = pW2DReaderCommon->m_z_plane;
123 out_z = pW2DReaderCommon->m_z_plane;
127 static void WT2HT(
const WT_Logical_Point & in,
Point & out,
const HW2DReaderCommon * pW2DReaderCommon)
128 { WT2HT(in.m_x, in.m_y, out.x, out.y, out.z, pW2DReaderCommon); }
130 static void WT2HT (
const float in_x,
const float in_y,
131 float & out_x,
float & out_y,
float & out_z,
134 if (pW2DReaderCommon->m_CoordMode == HW2DReaderCommon::recentered_coords)
136 out_x = in_x - pW2DReaderCommon->m_x_extents;
137 out_y = in_y - pW2DReaderCommon->m_y_extents;
138 out_z = pW2DReaderCommon->m_z_plane;
140 else if(pW2DReaderCommon->m_CoordMode == HW2DReaderCommon::application_coords)
142 WT_Point3D pt_in((
double)in_x, (
double)in_y);
143 WT_Point3D pt_out = pW2DReaderCommon->m_pWhipUnits->transform_from_DWF_to_application(pt_in);
146 out_z = pW2DReaderCommon->m_z_plane;
152 out_z = pW2DReaderCommon->m_z_plane;
158 WT_Logical_Point * wlp = in.points();
160 for (
int i = 0; i < in.count(); i++)
161 WT2HT(wlp[i], out[i], pW2DReaderCommon);
164 static void WT2HT(
const WT_Logical_Point * points,
int count,
Point * out,
HW2DReaderCommon * pW2DReaderCommon)
166 for (
int i = 0; i < count; i++)
167 WT2HT(points[i], out[i], pW2DReaderCommon);
170 void eliminate_special_chars(
char * zString);
Definition: HDWFMisc.h:43
Definition: HDWFMisc.h:22
The HBaseView class defines and manages a view of model information.
Definition: HBaseView.h:332
Definition: HW2DReaderCommon.h:33