All: Reformat according to new standard
This commit is contained in:
committed by
Kacper Donat
parent
eafd18dac0
commit
25c3ba7338
@@ -51,18 +51,24 @@ public:
|
||||
Module()
|
||||
: Py::ExtensionModule<Module>("JtReader")
|
||||
{
|
||||
add_varargs_method("read",
|
||||
&Module::read,
|
||||
"Read the mesh from a JT file and return a mesh object.");
|
||||
add_varargs_method("open",
|
||||
&Module::open,
|
||||
"open(string)\n"
|
||||
"Create a new document and load the JT file into\n"
|
||||
"the document.");
|
||||
add_varargs_method("insert",
|
||||
&Module::importer,
|
||||
"insert(string|mesh,[string])\n"
|
||||
"Load or insert a JT file into the given or active document.");
|
||||
add_varargs_method(
|
||||
"read",
|
||||
&Module::read,
|
||||
"Read the mesh from a JT file and return a mesh object."
|
||||
);
|
||||
add_varargs_method(
|
||||
"open",
|
||||
&Module::open,
|
||||
"open(string)\n"
|
||||
"Create a new document and load the JT file into\n"
|
||||
"the document."
|
||||
);
|
||||
add_varargs_method(
|
||||
"insert",
|
||||
&Module::importer,
|
||||
"insert(string|mesh,[string])\n"
|
||||
"Load or insert a JT file into the given or active document."
|
||||
);
|
||||
initialize("This module is the JtReader module.");
|
||||
}
|
||||
|
||||
@@ -104,7 +110,8 @@ private:
|
||||
App::Document* doc = App::GetApplication().newDocument();
|
||||
std::string objname = file.fileNamePure();
|
||||
auto iv = dynamic_cast<App::InventorObject*>(
|
||||
doc->addObject("App::InventorObject", objname.c_str()));
|
||||
doc->addObject("App::InventorObject", objname.c_str())
|
||||
);
|
||||
iv->Buffer.setValue(jtReader.getOutput());
|
||||
iv->purgeTouched();
|
||||
#endif
|
||||
@@ -140,7 +147,8 @@ private:
|
||||
|
||||
std::string objname = file.fileNamePure();
|
||||
auto iv = dynamic_cast<App::InventorObject*>(
|
||||
doc->addObject("App::InventorObject", objname.c_str()));
|
||||
doc->addObject("App::InventorObject", objname.c_str())
|
||||
);
|
||||
iv->Buffer.setValue(jtReader.getOutput());
|
||||
iv->purgeTouched();
|
||||
#endif
|
||||
|
||||
@@ -42,17 +42,19 @@ struct 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)
|
||||
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)
|
||||
|
||||
@@ -19,17 +19,19 @@
|
||||
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()
|
||||
{}
|
||||
|
||||
@@ -32,10 +32,10 @@ vector<SimpleMeshFacet> result;
|
||||
vector<SimpleMeshFacet>::const_iterator resultIt;
|
||||
|
||||
|
||||
#define indent(i) \
|
||||
{ \
|
||||
for (int l = 0; l < i; l++) \
|
||||
InfoOut << " "; \
|
||||
#define indent(i) \
|
||||
{ \
|
||||
for (int l = 0; l < i; l++) \
|
||||
InfoOut << " "; \
|
||||
}
|
||||
|
||||
void printXform(JtkTransform* partXform, int level)
|
||||
@@ -153,15 +153,17 @@ void printShape(JtkShape* partShape, int level)
|
||||
float *vertex = NULL, *normal = NULL, *color = NULL, *texture = NULL;
|
||||
int vertexCount = -1, normCount = -1, colorCount = -1, textCount = -1;
|
||||
|
||||
partShape->getInternal(vertex,
|
||||
vertexCount,
|
||||
normal,
|
||||
normCount,
|
||||
color,
|
||||
colorCount,
|
||||
texture,
|
||||
textCount,
|
||||
set);
|
||||
partShape->getInternal(
|
||||
vertex,
|
||||
vertexCount,
|
||||
normal,
|
||||
normCount,
|
||||
color,
|
||||
colorCount,
|
||||
texture,
|
||||
textCount,
|
||||
set
|
||||
);
|
||||
|
||||
if (vertex && (vertexCount > 0)) {
|
||||
indent(level + 2);
|
||||
@@ -425,15 +427,17 @@ void insertShapeFaces(JtkShape* partShape)
|
||||
float *vertex = NULL, *normal = NULL, *color = NULL, *texture = NULL;
|
||||
int vertexCount = -1, normCount = -1, colorCount = -1, textCount = -1;
|
||||
|
||||
partShape->getInternal(vertex,
|
||||
vertexCount,
|
||||
normal,
|
||||
normCount,
|
||||
color,
|
||||
colorCount,
|
||||
texture,
|
||||
textCount,
|
||||
set);
|
||||
partShape->getInternal(
|
||||
vertex,
|
||||
vertexCount,
|
||||
normal,
|
||||
normCount,
|
||||
color,
|
||||
colorCount,
|
||||
texture,
|
||||
textCount,
|
||||
set
|
||||
);
|
||||
|
||||
if (normCount < 3) {
|
||||
return;
|
||||
|
||||
@@ -147,8 +147,9 @@ void TKJtReader::readShapeVertex(const Handle(JtNode_Shape_Vertex) & aShape)
|
||||
anObject = aLateLoaded[index]->DefferedObject();
|
||||
}
|
||||
if (!anObject.IsNull()) {
|
||||
Handle(JtElement_ShapeLOD_TriStripSet) aLOD =
|
||||
Handle(JtElement_ShapeLOD_TriStripSet)::DownCast(anObject);
|
||||
Handle(JtElement_ShapeLOD_TriStripSet) aLOD = Handle(
|
||||
JtElement_ShapeLOD_TriStripSet
|
||||
)::DownCast(anObject);
|
||||
if (!aLOD.IsNull()) {
|
||||
getTriangleStripSet(aLOD);
|
||||
}
|
||||
@@ -224,8 +225,9 @@ void TKJtReader::readAttributes(const JtData_Object::VectorOfObjects& attr)
|
||||
for (std::size_t aAttrIdx = 0; aAttrIdx < attr.Count(); ++aAttrIdx) {
|
||||
Handle(JtData_Object) anAttr = attr[aAttrIdx];
|
||||
if (anAttr->IsKind(Type_JtAttribute_GeometricTransform)) {
|
||||
Handle(JtAttribute_GeometricTransform) aTransform =
|
||||
Handle(JtAttribute_GeometricTransform)::DownCast(anAttr);
|
||||
Handle(JtAttribute_GeometricTransform) aTransform = Handle(
|
||||
JtAttribute_GeometricTransform
|
||||
)::DownCast(anAttr);
|
||||
readTransformAttribute(aTransform);
|
||||
}
|
||||
else if (anAttr->IsKind(Type_JtAttribute_Material)) {
|
||||
|
||||
@@ -25,18 +25,18 @@
|
||||
#define JT_READER_TKJTREADER_H
|
||||
|
||||
#ifdef JTREADER_HAVE_TKJT
|
||||
#include <JtAttribute_GeometricTransform.hxx>
|
||||
#include <JtAttribute_Material.hxx>
|
||||
#include <JtData_Model.hxx>
|
||||
#include <JtElement_ShapeLOD_TriStripSet.hxx>
|
||||
#include <JtNode_Instance.hxx>
|
||||
#include <JtNode_Partition.hxx>
|
||||
#include <JtNode_RangeLOD.hxx>
|
||||
#include <JtNode_Shape_TriStripSet.hxx>
|
||||
#include <JtNode_Shape_Vertex.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <TCollection_ExtendedString.hxx>
|
||||
#include <Base/Builder3D.h>
|
||||
# include <JtAttribute_GeometricTransform.hxx>
|
||||
# include <JtAttribute_Material.hxx>
|
||||
# include <JtData_Model.hxx>
|
||||
# include <JtElement_ShapeLOD_TriStripSet.hxx>
|
||||
# include <JtNode_Instance.hxx>
|
||||
# include <JtNode_Partition.hxx>
|
||||
# include <JtNode_RangeLOD.hxx>
|
||||
# include <JtNode_Shape_TriStripSet.hxx>
|
||||
# include <JtNode_Shape_Vertex.hxx>
|
||||
# include <TCollection_AsciiString.hxx>
|
||||
# include <TCollection_ExtendedString.hxx>
|
||||
# include <Base/Builder3D.h>
|
||||
|
||||
namespace JtReaderNS
|
||||
{
|
||||
|
||||
@@ -43,8 +43,7 @@ void TestJtReader::read(void)
|
||||
{
|
||||
// const std::vector<TOC_Entry>& toc = readToc();
|
||||
|
||||
for (std::vector<TOC_Entry>::const_iterator i = TocEntries.begin(); i != TocEntries.end();
|
||||
++i) {
|
||||
for (std::vector<TOC_Entry>::const_iterator i = TocEntries.begin(); i != TocEntries.end(); ++i) {
|
||||
int segType = i->getSegmentType();
|
||||
|
||||
if (segType == 7) {
|
||||
|
||||
Reference in New Issue
Block a user