mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-17 02:49:12 +00:00
IfcConvert links on windows
This commit is contained in:
@@ -191,20 +191,20 @@ void ColladaSerializer::ColladaExporter::ColladaScene::add(
|
||||
node.setNodeName(node_name);
|
||||
node.setType(COLLADASW::Node::NODE);
|
||||
|
||||
// The matrix attribute of an entity is basically a 4x3 representation of its ObjectPlacement.
|
||||
// Note that this placement is absolute, ie it is multiplied with all parent placements.
|
||||
|
||||
ifcopenshell::geometry::Transformation* relative_trsf = 0;
|
||||
const ifcopenshell::geometry::Transformation* transformation_towrite = &transformation;
|
||||
|
||||
// If this is not the first parent, get the relative placement
|
||||
if (parentNodes.size() > 0)
|
||||
{
|
||||
relative_trsf = new ifcopenshell::geometry::Transformation(matrixStack.top().multiplied(transformation));
|
||||
auto m4 = ifcopenshell::geometry::taxonomy::matrix4(matrixStack.top().data().components * transformation.data().components);
|
||||
relative_trsf = new ifcopenshell::geometry::Transformation(transformation.settings(), m4);
|
||||
transformation_towrite = relative_trsf;
|
||||
}
|
||||
|
||||
const std::vector<real_t>& posmatrix = transformation_towrite->matrix().data();
|
||||
// @todo verify
|
||||
|
||||
const double* posmatrix = transformation_towrite->data().components.data();
|
||||
|
||||
double matrix_array[4][4] = {
|
||||
{ (double)posmatrix[0], (double)posmatrix[3], (double)posmatrix[6], (double)posmatrix[9] },
|
||||
@@ -251,11 +251,14 @@ void ColladaSerializer::ColladaExporter::ColladaScene::addParent(const ifcopensh
|
||||
// If this is not the first parent, get the relative placement
|
||||
if (parentNodes.size() > 0)
|
||||
{
|
||||
relative_trsf = new ifcopenshell::geometry::Transformation(matrixStack.top().multiplied(parent_trsf));
|
||||
auto m4 = ifcopenshell::geometry::taxonomy::matrix4(matrixStack.top().data().components * parent_trsf.data().components);
|
||||
relative_trsf = new ifcopenshell::geometry::Transformation(parent_trsf.settings(), m4);
|
||||
transformation_towrite = relative_trsf;
|
||||
}
|
||||
|
||||
const std::vector<real_t>& parentMatrix = transformation_towrite->matrix().data();
|
||||
// @todo verify
|
||||
|
||||
const double* parentMatrix = transformation_towrite->data().components.data();
|
||||
|
||||
double matrix_array[4][4] = {
|
||||
{ (double)parentMatrix[0], (double)parentMatrix[3], (double)parentMatrix[6], (double)parentMatrix[9] },
|
||||
@@ -277,7 +280,7 @@ void ColladaSerializer::ColladaExporter::ColladaScene::addParent(const ifcopensh
|
||||
current_node->addMatrix(matrix_array);
|
||||
|
||||
// Add the node to the parent stack
|
||||
matrixStack.push(parent_trsf.inverted());
|
||||
matrixStack.push(ifcopenshell::geometry::Transformation(parent_trsf.settings(), ifcopenshell::geometry::taxonomy::matrix4(parent_trsf.data().components.inverse())));
|
||||
parentNodes.push(current_node);
|
||||
serializer->parentStackId.push(parent.id());
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#ifndef OPENCASCADEBASEDSERIALIZER_H
|
||||
#define OPENCASCADEBASEDSERIALIZER_H
|
||||
|
||||
#include "../ifcgeom/schema_agnostic/opencascade/OpenCascadeConversionResult.h"
|
||||
#include "../ifcgeom/kernels/opencascade/OpenCascadeConversionResult.h"
|
||||
#include "../serializers/GeometrySerializer.h"
|
||||
|
||||
class OpenCascadeBasedSerializer : public GeometrySerializer {
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* *
|
||||
********************************************************************************/
|
||||
|
||||
#include "../ifcgeom/schema_agnostic/opencascade/OpenCascadeConversionResult.h"
|
||||
#include "../ifcgeom/kernels/opencascade/OpenCascadeConversionResult.h"
|
||||
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
#include "XmlSerializer.h"
|
||||
|
||||
extern void init_XmlSerializerIfc2x3(XmlSerializerFactory::Factory*);
|
||||
extern void init_XmlSerializerIfc4(XmlSerializerFactory::Factory*);
|
||||
extern void init_XmlSerializer_Ifc2x3(XmlSerializerFactory::Factory*);
|
||||
extern void init_XmlSerializer_Ifc4(XmlSerializerFactory::Factory*);
|
||||
extern void init_XmlSerializer_Ifc4x1(XmlSerializerFactory::Factory*);
|
||||
extern void init_XmlSerializer_Ifc4x2(XmlSerializerFactory::Factory*);
|
||||
|
||||
XmlSerializerFactory::Factory::Factory() {
|
||||
init_XmlSerializerIfc2x3(this);
|
||||
init_XmlSerializerIfc4(this);
|
||||
init_XmlSerializer_Ifc2x3(this);
|
||||
init_XmlSerializer_Ifc4(this);
|
||||
init_XmlSerializer_Ifc4x1(this);
|
||||
init_XmlSerializer_Ifc4x2(this);
|
||||
}
|
||||
|
||||
void XmlSerializerFactory::Factory::bind(const std::string& schema_name, fn f) {
|
||||
|
||||
Reference in New Issue
Block a user