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

Revision 13041, 1.3 kB (checked in by robert, 2 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#include "dxfTable.h"
13#include "dxfFile.h"
14#include "codeValue.h"
15
16
17void dxfLayer::assign(dxfFile*, codeValue& cv)
18{
19    switch (cv._groupCode) {
20        case 2:
21            _name = cv._string;
22            break;
23        case 62:
24            _color = cv._short;
25            if ((short)_color < 0) _frozen = true;
26            break;
27        case 70:
28            _frozen = (bool)(cv._short & 1);
29            break;
30    }
31}
32
33void dxfLayerTable::assign(dxfFile* dxf, codeValue& cv)
34{
35    std::string s = cv._string;
36    if (cv._groupCode == 0 ) {
37        if (_currentLayer.get()) {
38            _layers[_currentLayer->getName()] = _currentLayer.get();
39        }
40        if (s == "LAYER") {
41            _currentLayer = new dxfLayer;
42        } // otherwise it's the close call from ENDTAB
43    } else if (_currentLayer.get()) {
44        _currentLayer->assign(dxf, cv);
45    }
46}
Note: See TracBrowser for help on using the browser.