root/OpenSceneGraph/trunk/src/osgPlugins/dxf/dxfBlock.cpp @ 13041

Revision 13041, 1.6 kB (checked in by robert, 3 years ago)

Ran script to remove trailing spaces and tabs

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1/* dxfReader for OpenSceneGraph  Copyright (C) 2005 by GraphArchitecture ( grapharchitecture.com )
2 * Programmed by Paul de Repentigny <pdr@grapharchitecture.com>
3 *
4 * OpenSceneGraph is (C) 2004 Robert Osfield
5 *
6 * This library is provided as-is, without support of any kind.
7 *
8 * Read DXF docs or OSG docs for any related questions.
9 *
10 * You may contact the author if you have suggestions/corrections/enhancements.
11 */
12
13
14#include "dxfBlock.h"
15#include "dxfFile.h"
16#include "codeValue.h"
17#include "dxfEntity.h"
18
19using namespace std;
20
21void
22dxfBlock::assign(dxfFile* dxf, codeValue& cv)
23{
24    string s = cv._string;
25    if (cv._groupCode == 0) {
26        if (_currentEntity && _currentEntity->done()) {
27            _currentEntity = new dxfEntity(s);
28            _entityList.push_back(_currentEntity);
29        } else if (_currentEntity) {
30            _currentEntity->assign(dxf, cv);
31        } else {
32            _currentEntity = new dxfEntity(s);
33            _entityList.push_back(_currentEntity);
34        }
35    } else if (_currentEntity) {
36        _currentEntity->assign(dxf, cv);
37    } else if (cv._groupCode != 0) {
38        double d = cv._double;
39        switch (cv._groupCode) {
40            case 2:
41                _name = s;
42            case 10:
43                _position.x() = d;
44                break;
45            case 20:
46                _position.y() = d;
47                break;
48            case 30:
49                _position.z() = d;
50                break;
51            default:
52                // dxf garble
53                break;
54        }
55    }
56}
57
58const osg::Vec3d& dxfBlock::getPosition() const { return _position; }
Note: See TracBrowser for help on using the browser.