Points&Forces (core)
Software tools facilitating the task of surveying architecture
dxf
a_dxf_point.cxx
Go to the documentation of this file.
1
/*
2
Copyright 2002-2011 Pierre SMARS (smars@yuntech.edu.tw)
3
This program is free software: you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation, either version 2 of the License, or
6
(at your option) any later version.
7
8
This program is distributed in the hope that it will be useful,
9
but WITHOUT ANY WARRANTY; without even the implied warranty of
10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
GNU General Public License for more details.
12
13
You should have received a copy of the GNU General Public License
14
along with this program. If not, see <http://www.gnu.org/licenses/>.
15
*/
16
#include "
a_dxf_point.h
"
17
#include "
a_dxf_group.h
"
18
19
//---------------------------------------------------------------------------
20
a_dxf_point::a_dxf_point
(std::istream * file) :
a_dxf_entity
(file)
21
{
22
x_ok
=
false
;
y_ok
=
false
;
z_ok
=
false
;
23
}
24
//---------------------------------------------------------------------------
25
bool
a_dxf_point::read
()
26
{
27
a_dxf_group
group(
file_
);
28
layer_
=
"0"
;
29
for
(;;)
30
{
31
group.
read
();
32
if
(group.
code
()==8)
33
layer_
= group.
data
();
34
if
(group.
code
()==10)
35
{
36
x_
= group.
data_double
();
37
x_ok
=
true
;
38
}
39
if
(group.
code
()==20)
40
{
41
y_
= group.
data_double
();
42
y_ok
=
true
;
43
}
44
if
(group.
code
()==30)
45
{
46
z_
= group.
data_double
();
47
z_ok
=
true
;
48
}
49
if
(group.
code
()==0)
50
break
;
51
}
52
group.
putback
();
53
if
(
x_ok
&&
y_ok
&&
z_ok
)
54
return
true
;
55
else
56
return
false
;
57
}
a_dxf_group.h
a_dxf_point.h
a_dxf_entity
a generic dxf entity
Definition:
a_dxf_entity.h:29
a_dxf_entity::layer_
std::string layer_
Definition:
a_dxf_entity.h:38
a_dxf_entity::file_
std::istream * file_
Definition:
a_dxf_entity.h:37
a_dxf_group
a dxf group
Definition:
a_dxf_group.h:30
a_dxf_group::data_double
double data_double()
Definition:
a_dxf_group.cxx:90
a_dxf_group::code
int code()
Definition:
a_dxf_group.h:36
a_dxf_group::putback
void putback()
Definition:
a_dxf_group.cxx:68
a_dxf_group::read
bool read()
Definition:
a_dxf_group.cxx:21
a_dxf_group::data
std::string data()
Definition:
a_dxf_group.h:37
a_dxf_point::read
bool read()
Definition:
a_dxf_point.cxx:25
a_dxf_point::y_ok
bool y_ok
Definition:
a_dxf_point.h:40
a_dxf_point::x_ok
bool x_ok
Definition:
a_dxf_point.h:39
a_dxf_point::z_
double z_
Definition:
a_dxf_point.h:41
a_dxf_point::x_
double x_
Definition:
a_dxf_point.h:39
a_dxf_point::a_dxf_point
a_dxf_point(std::istream *file)
Definition:
a_dxf_point.cxx:20
a_dxf_point::z_ok
bool z_ok
Definition:
a_dxf_point.h:41
a_dxf_point::y_
double y_
Definition:
a_dxf_point.h:40
Generated on Tue Sep 6 2022 18:50:16 for Points&Forces (core) by
1.9.1