JtReader: Apply clang format
This commit is contained in:
@@ -1,46 +1,44 @@
|
||||
/**************************************************************************
|
||||
* Copyright (c) 2014 Juergen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public *
|
||||
* License along with this library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
* Copyright (c) 2014 Juergen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public *
|
||||
* License along with this library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef Context_HEADER
|
||||
#define Context_HEADER
|
||||
|
||||
#include "Context.h"
|
||||
#include <istream>
|
||||
#include <stdint.h>
|
||||
#include "Context.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
class Context
|
||||
{
|
||||
public:
|
||||
Context(istream &s) :Strm(s){};
|
||||
Context(istream& s)
|
||||
: Strm(s) {};
|
||||
uint8_t VersionMinor;
|
||||
uint8_t VersionMajor;
|
||||
|
||||
istream & Strm;
|
||||
|
||||
istream& Strm;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,37 +1,36 @@
|
||||
/**************************************************************************
|
||||
* Copyright (c) 2014 Juergen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public *
|
||||
* License along with this library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
* Copyright (c) 2014 Juergen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public *
|
||||
* License along with this library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef Element_Header_HEADER
|
||||
#define Element_Header_HEADER
|
||||
|
||||
#include <assert.h>
|
||||
#include <istream>
|
||||
#include <stdint.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "Context.h"
|
||||
#include "GUID.h"
|
||||
#include "UChar.h"
|
||||
#include "I32.h"
|
||||
|
||||
#include "UChar.h"
|
||||
|
||||
|
||||
using namespace std;
|
||||
@@ -39,14 +38,14 @@ using namespace std;
|
||||
|
||||
struct Element_Header
|
||||
{
|
||||
Element_Header(){};
|
||||
Element_Header() {};
|
||||
|
||||
Element_Header(Context& cont, bool zLib=false)
|
||||
Element_Header(Context& cont, bool zLib = false)
|
||||
{
|
||||
read(cont, zLib);
|
||||
};
|
||||
|
||||
inline void read(Context& cont ,bool zLib=false)
|
||||
inline void read(Context& cont, bool zLib = false)
|
||||
{
|
||||
// only zip less implemented so far...
|
||||
assert(zLib == false);
|
||||
@@ -56,20 +55,10 @@ struct Element_Header
|
||||
Object_Base_Type.read(cont);
|
||||
};
|
||||
|
||||
I32 Element_Length;
|
||||
I32 Element_Length;
|
||||
GUID Object_Type_ID;
|
||||
UChar Object_Base_Type;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2014 Juergen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public *
|
||||
* License along with this library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
* Copyright (c) 2014 Juergen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public *
|
||||
* License along with this library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef GUID_HEADER
|
||||
#define GUID_HEADER
|
||||
@@ -27,10 +27,9 @@
|
||||
#include <sstream>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "U8.h"
|
||||
#include "U16.h"
|
||||
#include "U32.h"
|
||||
|
||||
#include "U8.h"
|
||||
|
||||
|
||||
using namespace std;
|
||||
@@ -39,10 +38,30 @@ using namespace std;
|
||||
|
||||
struct GUID
|
||||
{
|
||||
GUID(){};
|
||||
GUID() {};
|
||||
|
||||
GUID(uint32_t a1, uint16_t b1, uint16_t b2, uint8_t c1, uint8_t c2, uint8_t c3, uint8_t c4, uint8_t c5, uint8_t c6, uint8_t c7, uint8_t c8)
|
||||
:_A1(a1), _B1(b1), _B2(b2), _C1(c1), _C2(c2), _C3(c3), _C4(c4), _C5(c5), _C6(c6), _C7(c7), _C8(c8)
|
||||
GUID(uint32_t a1,
|
||||
uint16_t b1,
|
||||
uint16_t b2,
|
||||
uint8_t c1,
|
||||
uint8_t c2,
|
||||
uint8_t c3,
|
||||
uint8_t c4,
|
||||
uint8_t c5,
|
||||
uint8_t c6,
|
||||
uint8_t c7,
|
||||
uint8_t c8)
|
||||
: _A1(a1)
|
||||
, _B1(b1)
|
||||
, _B2(b2)
|
||||
, _C1(c1)
|
||||
, _C2(c2)
|
||||
, _C3(c3)
|
||||
, _C4(c4)
|
||||
, _C5(c5)
|
||||
, _C6(c6)
|
||||
, _C7(c7)
|
||||
, _C8(c8)
|
||||
{}
|
||||
|
||||
GUID(Context& cont)
|
||||
@@ -50,23 +69,16 @@ struct GUID
|
||||
read(cont);
|
||||
}
|
||||
|
||||
bool operator!=(const GUID& other) const {
|
||||
return !operator == (other);
|
||||
bool operator!=(const GUID& other) const
|
||||
{
|
||||
return !operator==(other);
|
||||
}
|
||||
|
||||
bool operator==(const GUID& other) const {
|
||||
return
|
||||
_A1 == other._A1
|
||||
&& _B1 == other._B1
|
||||
&& _B2 == other._B2
|
||||
&& _C1 == other._C1
|
||||
&& _C2 == other._C2
|
||||
&& _C3 == other._C3
|
||||
&& _C4 == other._C4
|
||||
&& _C5 == other._C5
|
||||
&& _C6 == other._C6
|
||||
&& _C7 == other._C7
|
||||
&& _C8 == other._C8;
|
||||
bool operator==(const GUID& other) const
|
||||
{
|
||||
return _A1 == other._A1 && _B1 == other._B1 && _B2 == other._B2 && _C1 == other._C1
|
||||
&& _C2 == other._C2 && _C3 == other._C3 && _C4 == other._C4 && _C5 == other._C5
|
||||
&& _C6 == other._C6 && _C7 == other._C7 && _C8 == other._C8;
|
||||
}
|
||||
|
||||
inline void read(Context& cont)
|
||||
@@ -86,9 +98,11 @@ struct GUID
|
||||
_C8.read(cont);
|
||||
}
|
||||
|
||||
std::string toString()const{
|
||||
std::string toString() const
|
||||
{
|
||||
std::stringstream strm;
|
||||
strm << "{" << std::hex << _A1 << "-" << _B1 << _B2 << "-" << _C1 << _C2 << _C3 << _C4 << _C5 << _C6 << _C7 << _C8 << "}";
|
||||
strm << "{" << std::hex << _A1 << "-" << _B1 << _B2 << "-" << _C1 << _C2 << _C3 << _C4
|
||||
<< _C5 << _C6 << _C7 << _C8 << "}";
|
||||
return strm.str();
|
||||
}
|
||||
|
||||
@@ -97,17 +111,15 @@ struct GUID
|
||||
U16 _B1;
|
||||
U16 _B2;
|
||||
|
||||
U8 _C1;
|
||||
U8 _C2;
|
||||
U8 _C3;
|
||||
U8 _C4;
|
||||
U8 _C5;
|
||||
U8 _C6;
|
||||
U8 _C7;
|
||||
U8 _C8;
|
||||
|
||||
U8 _C1;
|
||||
U8 _C2;
|
||||
U8 _C3;
|
||||
U8 _C4;
|
||||
U8 _C5;
|
||||
U8 _C6;
|
||||
U8 _C7;
|
||||
U8 _C8;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
/**************************************************************************
|
||||
* Copyright (c) 2014 Juergen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public *
|
||||
* License along with this library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
* Copyright (c) 2014 Juergen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public *
|
||||
* License along with this library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef I32_HEADER
|
||||
#define I32_HEADER
|
||||
@@ -30,7 +30,7 @@ using namespace std;
|
||||
|
||||
struct I32
|
||||
{
|
||||
I32(){};
|
||||
I32() {};
|
||||
|
||||
I32(Context& cont)
|
||||
{
|
||||
@@ -51,5 +51,4 @@ struct I32
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
#include "Element_Header.h"
|
||||
#include "GUID.h"
|
||||
#include "I32.h"
|
||||
#include "LodHandler.h"
|
||||
#include "Element_Header.h"
|
||||
#include "Segment_Header.h"
|
||||
#include "TOC_Entry.h"
|
||||
#include "UChar.h"
|
||||
@@ -17,81 +17,90 @@
|
||||
using namespace std;
|
||||
|
||||
|
||||
const GUID JtReader::TriStripSetShapeLODElement_ID(0x10dd10ab, 0x2ac8, 0x11d1, 0x9b, 0x6b, 0x0, 0x80, 0xc7, 0xbb, 0x59, 0x97);
|
||||
const GUID JtReader::TriStripSetShapeLODElement_ID(0x10dd10ab,
|
||||
0x2ac8,
|
||||
0x11d1,
|
||||
0x9b,
|
||||
0x6b,
|
||||
0x0,
|
||||
0x80,
|
||||
0xc7,
|
||||
0xbb,
|
||||
0x59,
|
||||
0x97);
|
||||
|
||||
JtReader::JtReader()
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
|
||||
JtReader::~JtReader()
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
void JtReader::setFile(const std::string fileName)
|
||||
{
|
||||
this->_fileName = fileName;
|
||||
this->_fileName = fileName;
|
||||
}
|
||||
|
||||
const std::vector<TOC_Entry>& JtReader::readToc()
|
||||
{
|
||||
ifstream strm;
|
||||
ifstream strm;
|
||||
|
||||
strm.open(_fileName, ios::binary);
|
||||
strm.open(_fileName, ios::binary);
|
||||
|
||||
if (!strm)
|
||||
throw "cannot open file";
|
||||
if (!strm) {
|
||||
throw "cannot open file";
|
||||
}
|
||||
|
||||
|
||||
Context cont(strm);
|
||||
Context cont(strm);
|
||||
|
||||
char headerString[80];
|
||||
strm.read(headerString, 80);
|
||||
char headerString[80];
|
||||
strm.read(headerString, 80);
|
||||
|
||||
UChar Byte_Order(cont);
|
||||
I32 Empty_Field(cont);
|
||||
I32 TOC_Offset(cont);
|
||||
UChar Byte_Order(cont);
|
||||
I32 Empty_Field(cont);
|
||||
I32 TOC_Offset(cont);
|
||||
|
||||
GUID LSG_Segment_ID(cont);
|
||||
GUID LSG_Segment_ID(cont);
|
||||
|
||||
|
||||
cont.Strm.seekg((int32_t)TOC_Offset);
|
||||
|
||||
I32 Entry_Count(cont);
|
||||
|
||||
cont.Strm.seekg((int32_t)TOC_Offset);
|
||||
|
||||
I32 Entry_Count(cont);
|
||||
|
||||
TocEntries.resize(Entry_Count);
|
||||
|
||||
for (std::vector<TOC_Entry>::iterator i = TocEntries.begin(); i != TocEntries.end(); ++i)
|
||||
i->read(cont);
|
||||
|
||||
return TocEntries;
|
||||
|
||||
for (std::vector<TOC_Entry>::iterator i = TocEntries.begin(); i != TocEntries.end(); ++i) {
|
||||
i->read(cont);
|
||||
}
|
||||
|
||||
return TocEntries;
|
||||
}
|
||||
|
||||
void JtReader::readLodSegment(const TOC_Entry& toc, LodHandler& /*handler*/)
|
||||
{
|
||||
std::ifstream strm;
|
||||
strm.open(_fileName, ios::binary);
|
||||
std::ifstream strm;
|
||||
strm.open(_fileName, ios::binary);
|
||||
|
||||
if (!strm) throw "cannot open file";
|
||||
if (!strm) {
|
||||
throw "cannot open file";
|
||||
}
|
||||
|
||||
strm.seekg((int32_t)toc.Segment_Offset);
|
||||
strm.seekg((int32_t)toc.Segment_Offset);
|
||||
|
||||
Context cont(strm);
|
||||
Context cont(strm);
|
||||
|
||||
|
||||
// check if called with the right Toc
|
||||
assert(toc.getSegmentType() == 7);
|
||||
|
||||
// read the segment header
|
||||
Segment_Header header(cont);
|
||||
// check if called with the right Toc
|
||||
assert(toc.getSegmentType() == 7);
|
||||
|
||||
// read the non zip Element header
|
||||
Element_Header eHeader(cont, false);
|
||||
// read the segment header
|
||||
Segment_Header header(cont);
|
||||
|
||||
if ( eHeader.Object_Type_ID != TriStripSetShapeLODElement_ID)
|
||||
return;
|
||||
// read the non zip Element header
|
||||
Element_Header eHeader(cont, false);
|
||||
|
||||
|
||||
if (eHeader.Object_Type_ID != TriStripSetShapeLODElement_ID) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,33 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include "TOC_Entry.h"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "TOC_Entry.h"
|
||||
|
||||
class LodHandler;
|
||||
|
||||
|
||||
|
||||
class JtReader
|
||||
{
|
||||
public:
|
||||
JtReader();
|
||||
~JtReader();
|
||||
JtReader();
|
||||
~JtReader();
|
||||
|
||||
void setFile(const std::string fileName);
|
||||
void setFile(const std::string fileName);
|
||||
|
||||
const std::vector<TOC_Entry>& readToc();
|
||||
const std::vector<TOC_Entry>& readToc();
|
||||
|
||||
void readSegment(int tocIndex);
|
||||
void readSegment(int tocIndex);
|
||||
|
||||
void readLodSegment(const TOC_Entry&, LodHandler&);
|
||||
void readLodSegment(const TOC_Entry&, LodHandler&);
|
||||
|
||||
static const GUID TriStripSetShapeLODElement_ID;
|
||||
static const GUID TriStripSetShapeLODElement_ID;
|
||||
|
||||
|
||||
protected:
|
||||
std::string _fileName;
|
||||
vector<TOC_Entry> TocEntries;
|
||||
|
||||
std::string _fileName;
|
||||
vector<TOC_Entry> TocEntries;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,41 +1,34 @@
|
||||
/**************************************************************************
|
||||
* Copyright (c) 2014 Juergen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public *
|
||||
* License along with this library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
* Copyright (c) 2014 Juergen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public *
|
||||
* License along with this library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef LodHandler_HEADER
|
||||
#define LodHandler_HEADER
|
||||
|
||||
|
||||
|
||||
class LodHandler
|
||||
{
|
||||
public:
|
||||
virtual void startLod(){};
|
||||
|
||||
|
||||
|
||||
virtual void startLod() {};
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
/**************************************************************************
|
||||
* Copyright (c) 2014 Juergen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public *
|
||||
* License along with this library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
* Copyright (c) 2014 Juergen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public *
|
||||
* License along with this library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef Segment_Header_HEADER
|
||||
#define Segment_Header_HEADER
|
||||
@@ -28,10 +28,9 @@
|
||||
|
||||
#include "Context.h"
|
||||
#include "GUID.h"
|
||||
#include "I32.h"
|
||||
#include "U16.h"
|
||||
#include "U32.h"
|
||||
#include "I32.h"
|
||||
|
||||
|
||||
|
||||
using namespace std;
|
||||
@@ -39,7 +38,7 @@ using namespace std;
|
||||
|
||||
struct Segment_Header
|
||||
{
|
||||
Segment_Header(){};
|
||||
Segment_Header() {};
|
||||
|
||||
Segment_Header(Context& cont)
|
||||
{
|
||||
@@ -54,15 +53,9 @@ struct Segment_Header
|
||||
};
|
||||
|
||||
GUID Segment_ID;
|
||||
I32 Segment_Type;
|
||||
I32 Segment_Length;
|
||||
|
||||
|
||||
I32 Segment_Type;
|
||||
I32 Segment_Length;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
/**************************************************************************
|
||||
* Copyright (c) 2014 Juergen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public *
|
||||
* License along with this library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
* Copyright (c) 2014 Juergen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public *
|
||||
* License along with this library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef TOC_Entry_HEADER
|
||||
#define TOC_Entry_HEADER
|
||||
@@ -28,10 +28,9 @@
|
||||
|
||||
#include "Context.h"
|
||||
#include "GUID.h"
|
||||
#include "I32.h"
|
||||
#include "U16.h"
|
||||
#include "U32.h"
|
||||
#include "I32.h"
|
||||
|
||||
|
||||
|
||||
using namespace std;
|
||||
@@ -39,7 +38,7 @@ using namespace std;
|
||||
|
||||
struct TOC_Entry
|
||||
{
|
||||
TOC_Entry(){};
|
||||
TOC_Entry() {};
|
||||
|
||||
TOC_Entry(Context& cont)
|
||||
{
|
||||
@@ -54,26 +53,25 @@ struct TOC_Entry
|
||||
Segment_Attributes.read(cont);
|
||||
};
|
||||
|
||||
uint8_t getSegmentType()const
|
||||
uint8_t getSegmentType() const
|
||||
{
|
||||
return Segment_Attributes >> 24;
|
||||
}
|
||||
|
||||
std::string toString()const{
|
||||
std::string toString() const
|
||||
{
|
||||
stringstream strm;
|
||||
strm << getSegmentType() << ":" << Segment_Offset << ":" << Segment_Length << ":" << Segment_ID.toString();
|
||||
strm << getSegmentType() << ":" << Segment_Offset << ":" << Segment_Length << ":"
|
||||
<< Segment_ID.toString();
|
||||
|
||||
return strm.str();
|
||||
}
|
||||
|
||||
GUID Segment_ID;
|
||||
I32 Segment_Offset;
|
||||
I32 Segment_Length;
|
||||
U32 Segment_Attributes;
|
||||
|
||||
|
||||
I32 Segment_Offset;
|
||||
I32 Segment_Length;
|
||||
U32 Segment_Attributes;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
/**************************************************************************
|
||||
* Copyright (c) 2014 Juergen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public *
|
||||
* License along with this library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
* Copyright (c) 2014 Juergen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public *
|
||||
* License along with this library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef U16_HEADER
|
||||
#define U16_HEADER
|
||||
@@ -30,9 +30,11 @@ using namespace std;
|
||||
|
||||
struct U16
|
||||
{
|
||||
U16(){};
|
||||
U16() {};
|
||||
|
||||
U16(uint16_t ui) :_U16(ui){}
|
||||
U16(uint16_t ui)
|
||||
: _U16(ui)
|
||||
{}
|
||||
|
||||
U16(Context& cont)
|
||||
{
|
||||
@@ -53,5 +55,4 @@ struct U16
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
/**************************************************************************
|
||||
* Copyright (c) 2014 Juergen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public *
|
||||
* License along with this library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
* Copyright (c) 2014 Juergen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public *
|
||||
* License along with this library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef U32_HEADER
|
||||
#define U32_HEADER
|
||||
@@ -30,9 +30,11 @@ using namespace std;
|
||||
|
||||
struct U32
|
||||
{
|
||||
U32(){};
|
||||
U32() {};
|
||||
|
||||
U32(uint32_t ui) :_U32(ui){}
|
||||
U32(uint32_t ui)
|
||||
: _U32(ui)
|
||||
{}
|
||||
|
||||
U32(Context& cont)
|
||||
{
|
||||
@@ -53,6 +55,4 @@ struct U32
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,39 +1,41 @@
|
||||
/**************************************************************************
|
||||
* Copyright (c) 2014 Juergen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public *
|
||||
* License along with this library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
* Copyright (c) 2014 Juergen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public *
|
||||
* License along with this library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef U8_HEADER
|
||||
#define U8_HEADER
|
||||
|
||||
#include "Context.h"
|
||||
#include <istream>
|
||||
#include <stdint.h>
|
||||
#include "Context.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
struct U8
|
||||
{
|
||||
U8(){};
|
||||
U8() {};
|
||||
|
||||
U8(uint8_t ui) :_U8(ui){}
|
||||
U8(uint8_t ui)
|
||||
: _U8(ui)
|
||||
{}
|
||||
|
||||
U8(Context& cont)
|
||||
{
|
||||
@@ -51,9 +53,8 @@ struct U8
|
||||
}
|
||||
|
||||
|
||||
|
||||
uint8_t _U8;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,37 +1,37 @@
|
||||
/**************************************************************************
|
||||
* Copyright (c) 2014 Juergen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public *
|
||||
* License along with this library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
* Copyright (c) 2014 Juergen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public *
|
||||
* License along with this library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef UChar_HEADER
|
||||
#define UChar_HEADER
|
||||
|
||||
#include "Context.h"
|
||||
#include <istream>
|
||||
#include <stdint.h>
|
||||
#include "Context.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
struct UChar
|
||||
{
|
||||
UChar(){};
|
||||
UChar() {};
|
||||
|
||||
UChar(Context& cont)
|
||||
{
|
||||
@@ -52,5 +52,4 @@ struct UChar
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user