LibreOffice Module vcl (master)
1
vcl
source
filter
idxf
dxfblkrd.cxx
Go to the documentation of this file.
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/*
3
* This file is part of the LibreOffice project.
4
*
5
* This Source Code Form is subject to the terms of the Mozilla Public
6
* License, v. 2.0. If a copy of the MPL was not distributed with this
7
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
*
9
* This file incorporates work covered by the following license notice:
10
*
11
* Licensed to the Apache Software Foundation (ASF) under one or more
12
* contributor license agreements. See the NOTICE file distributed
13
* with this work for additional information regarding copyright
14
* ownership. The ASF licenses this file to you under the Apache
15
* License, Version 2.0 (the "License"); you may not use this file
16
* except in compliance with the License. You may obtain a copy of
17
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
18
*/
19
20
21
#include "
dxfblkrd.hxx
"
22
23
24
//---------------- DXFBlock --------------------------------------------------
25
26
27
DXFBlock::DXFBlock
()
28
: pSucc(nullptr)
29
, nFlags(0)
30
{
31
}
32
33
34
DXFBlock::~DXFBlock
()
35
{
36
}
37
38
39
void
DXFBlock::Read
(
DXFGroupReader
& rDGR)
40
{
41
m_sName
=
""
;
42
m_sAlsoName
=
""
;
43
aBasePoint
.
fx
=0.0;
44
aBasePoint
.
fy
=0.0;
45
aBasePoint
.
fz
=0.0;
46
nFlags
=0;
47
m_sXRef
=
""
;
48
49
while
(rDGR.
Read
()!=0)
50
{
51
switch
(rDGR.
GetG
())
52
{
53
case
2:
m_sName
= rDGR.
GetS
();
break
;
54
case
3:
m_sAlsoName
= rDGR.
GetS
();
break
;
55
case
70:
nFlags
=rDGR.
GetI
();
break
;
56
case
10:
aBasePoint
.
fx
=rDGR.
GetF
();
break
;
57
case
20:
aBasePoint
.
fy
=rDGR.
GetF
();
break
;
58
case
30:
aBasePoint
.
fz
=rDGR.
GetF
();
break
;
59
case
1:
m_sXRef
= rDGR.
GetS
();
break
;
60
}
61
}
62
DXFEntities::Read
(rDGR);
63
}
64
65
66
//---------------- DXFBlocks -------------------------------------------------
67
68
69
DXFBlocks::DXFBlocks
()
70
{
71
pFirst
=
nullptr
;
72
}
73
74
75
DXFBlocks::~DXFBlocks
()
76
{
77
Clear
();
78
}
79
80
81
void
DXFBlocks::Read
(
DXFGroupReader
& rDGR)
82
{
83
DXFBlock
* pB, * * ppSucc;
84
85
ppSucc=&
pFirst
;
86
while
(*ppSucc!=
nullptr
) ppSucc=&((*ppSucc)->pSucc);
87
88
for
(;;) {
89
while
(rDGR.
GetG
()!=0) rDGR.
Read
();
90
if
(rDGR.
GetS
() ==
"ENDSEC"
||
91
rDGR.
GetS
() ==
"EOF"
)
break
;
92
if
(rDGR.
GetS
() ==
"BLOCK"
) {
93
pB=
new
DXFBlock
;
94
pB->
Read
(rDGR);
95
*ppSucc=pB;
96
ppSucc=&(pB->
pSucc
);
97
}
98
else
rDGR.
Read
();
99
}
100
}
101
102
103
DXFBlock
*
DXFBlocks::Search
(std::string_view rName)
const
104
{
105
DXFBlock
* pB;
106
for
(pB=
pFirst
; pB!=
nullptr
; pB=pB->
pSucc
) {
107
if
(rName == pB->
m_sName
)
break
;
108
}
109
return
pB;
110
}
111
112
113
void
DXFBlocks::Clear
()
114
{
115
DXFBlock
* ptmp;
116
117
while
(
pFirst
!=
nullptr
) {
118
ptmp=
pFirst
;
119
pFirst
=ptmp->
pSucc
;
120
delete
ptmp;
121
}
122
}
123
124
125
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
DXFBlock
Definition:
dxfblkrd.hxx:32
DXFBlock::~DXFBlock
~DXFBlock()
Definition:
dxfblkrd.cxx:34
DXFBlock::nFlags
tools::Long nFlags
Definition:
dxfblkrd.hxx:42
DXFBlock::aBasePoint
DXFVector aBasePoint
Definition:
dxfblkrd.hxx:43
DXFBlock::Read
void Read(DXFGroupReader &rDGR)
Definition:
dxfblkrd.cxx:39
DXFBlock::pSucc
DXFBlock * pSucc
Definition:
dxfblkrd.hxx:36
DXFBlock::m_sXRef
OString m_sXRef
Definition:
dxfblkrd.hxx:44
DXFBlock::m_sName
OString m_sName
Definition:
dxfblkrd.hxx:40
DXFBlock::DXFBlock
DXFBlock()
Definition:
dxfblkrd.cxx:27
DXFBlock::m_sAlsoName
OString m_sAlsoName
Definition:
dxfblkrd.hxx:41
DXFBlocks::~DXFBlocks
~DXFBlocks()
Definition:
dxfblkrd.cxx:75
DXFBlocks::Read
void Read(DXFGroupReader &rDGR)
Definition:
dxfblkrd.cxx:81
DXFBlocks::pFirst
DXFBlock * pFirst
Definition:
dxfblkrd.hxx:60
DXFBlocks::DXFBlocks
DXFBlocks()
Definition:
dxfblkrd.cxx:69
DXFBlocks::Search
DXFBlock * Search(std::string_view rName) const
Definition:
dxfblkrd.cxx:103
DXFBlocks::Clear
void Clear()
Definition:
dxfblkrd.cxx:113
DXFEntities::Read
void Read(DXFGroupReader &rDGR)
Definition:
dxfentrd.cxx:792
DXFGroupReader
Definition:
dxfgrprd.hxx:29
DXFGroupReader::GetS
const OString & GetS() const
Definition:
dxfgrprd.hxx:106
DXFGroupReader::GetI
tools::Long GetI() const
Definition:
dxfgrprd.hxx:96
DXFGroupReader::GetF
double GetF() const
Definition:
dxfgrprd.hxx:101
DXFGroupReader::GetG
sal_uInt16 GetG() const
Definition:
dxfgrprd.hxx:91
DXFGroupReader::Read
sal_uInt16 Read()
Definition:
dxfgrprd.cxx:118
DXFVector::fx
double fx
Definition:
dxfvec.hxx:54
DXFVector::fz
double fz
Definition:
dxfvec.hxx:54
DXFVector::fy
double fy
Definition:
dxfvec.hxx:54
dxfblkrd.hxx
Generated on Sun Jul 30 2023 04:35:21 for LibreOffice Module vcl (master) by
1.9.3