Commit 1445d3fe authored by Jan Möbius's avatar Jan Möbius

Merge branch 'master' into GLUT

parents ca96a23e 7d591916
......@@ -51,6 +51,7 @@
//== INCLUDES =================================================================
#include "ACG/Scenegraph/DrawModes.hh"
#include "DrawModeConverter.hh"
//== TYPEDEFS =================================================================
......@@ -175,6 +176,8 @@ ACG::SceneGraph::DrawModes::DrawMode listToDrawMode( std::vector< QString > _dra
drawMode = drawMode | ACG::SceneGraph::DrawModes::SOLID_SHADER;
} else if( _draw_modes[i] == "SOLID_SMOOTH_SHADED_FEATURES" ) {
drawMode = drawMode | ACG::SceneGraph::DrawModes::SOLID_SMOOTH_SHADED_FEATURES;
} else {
drawMode |= ACG::SceneGraph::DrawModes::getDrawMode(_draw_modes[i].toStdString());
}
}
......@@ -240,6 +243,8 @@ ACG::SceneGraph::DrawModes::DrawMode descriptionsToDrawMode ( std::vector< QStri
drawMode = drawMode | ACG::SceneGraph::DrawModes::SOLID_SHADER;
} else if( _draw_modes[i] == "Solid (smooth shaded, features)" ) {
drawMode = drawMode | ACG::SceneGraph::DrawModes::SOLID_SMOOTH_SHADED_FEATURES;
} else {
drawMode |= ACG::SceneGraph::DrawModes::getDrawMode(_draw_modes[i].toStdString());
}
}
......
......@@ -28,6 +28,8 @@
- Clamp shininess in Materialnode (caused GL Errors)
- Better Material support in Materialnode (emissive and refractive materials)
- Use ShaderGenerator for picking shaders
- Plane type added (Removed duplicate implementations from other plugins)
- ACG DrawModeConverter: also convert dynamically added drawmodes
- <b>Plugins</b>
- File-OBJ
- Read emissive and refractive materials
......
......@@ -380,7 +380,7 @@ private: // data
#if defined(INCLUDE_TEMPLATES) && !defined(INIFILE_C)
#define INIFILE_TEMPLATES
#include "INIFileT.cc"
#include "INIFileT_impl.hh"
#endif
#endif
......@@ -42,6 +42,7 @@
#include <pybind11/include/pybind11/pybind11.h>
#include <pybind11/include/pybind11/embed.h>
#include <pybind11/include/pybind11/numpy.h>
#include "PyLogHook.h"
......@@ -51,6 +52,8 @@
#include <QMetaObject>
#include <QMetaMethod>
#include "PythonTypeConversions.hh"
namespace py = pybind11;
static Core* core_;
......@@ -191,7 +194,7 @@ bool PythonInterpreter::runScript(QString _script) {
std::cerr << "Now executing script:" << std::endl;
std::cerr << _script.toStdString() << std::endl;
py::exec((const char*)_script.toLatin1(), py::globals(), locals);
py::exec(_script.toStdString(), py::globals(), locals);
std::cerr << "Finished successfully" << std::endl;
}
......@@ -229,7 +232,7 @@ QString PythonInterpreter::runScriptOutput(QString _script) {
void PythonInterpreter::pyOutput(const char* w)
{
if (externalLogging_) {
std::cerr << "Python output:\n " << w << std::endl;
std::cerr << "Python output: " << w << std::endl;
Q_EMIT log(LOGOUT, QString(w));
} else {
LogOut += QString::fromUtf8(w);
......@@ -239,62 +242,14 @@ void PythonInterpreter::pyOutput(const char* w)
void PythonInterpreter::pyError(const char* w)
{
if (externalLogging_) {
std::cerr << "Python error:\n " << w << std::endl;
std::cerr << "Python error: " << w << std::endl;
Q_EMIT log(LOGERR, QString(w));
} else {
LogErr += QString::fromUtf8(w);
}
}
namespace pybind11 { namespace detail {
template <> struct type_caster<QString> {
public:
/**
* This macro establishes the name 'str' in
* function signatures and declares a local variable
* 'value' of type QVariant
*/
PYBIND11_TYPE_CASTER(QString, _("str"));
/**
* Conversion part 1 (Python->C++): convert a PyObject into a inty
* instance or return false upon failure. The second argument
* indicates whether implicit conversions should be applied.
*/
bool load(handle src, bool ) {
/* Extract PyObject from handle */
PyObject *source = src.ptr();
if (!PyUnicode_Check(source))
return false;
Py_ssize_t size;
const char *ptr = PyUnicode_AsUTF8AndSize(source, &size);
if (!ptr) {
return NULL;
}
/* Now try to convert into a C++ int */
value = QString::fromUtf8(ptr, size);
/* Ensure return code was OK (to avoid out-of-range errors etc) */
return ( !PyErr_Occurred() );
}
/**
* Conversion part 2 (C++ -> Python): convert an QVariant instance into
* a Python object. The second and third arguments are used to
* indicate the return value policy and parent object (for
* ``return_value_policy::reference_internal``) and are generally
* ignored by implicit casters.
*/
static handle cast(QString src, return_value_policy /* policy */, handle /* parent */) {
return (PyUnicode_FromString( src.toUtf8().data()) );
}
};
}} // namespace pybind11::detail
PYBIND11_EMBEDDED_MODULE(openflipper, m) {
......@@ -308,8 +263,6 @@ PYBIND11_EMBEDDED_MODULE(openflipper, m) {
// to work on the existing one.
core.def(py::init([]() { return core_; }));
core.def("updateView", &Core::updateView, QCoreApplication::translate("PythonDocCore","Redraw the contents of the viewer.").toLatin1().data() );
core.def("blockScenegraphUpdates", &Core::blockScenegraphUpdates, QCoreApplication::translate("PythonDocCore","Disable Scenegraph Updates (e.g. before loading or adding a large number of files)").toLatin1().data() );
core.def("updateUI", &Core::updateUI, QCoreApplication::translate("PythonDocCore","Process events during script execution to keep the ui alive").toLatin1().data() );
......
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (c) 2001-2015, RWTH-Aachen University *
* Department of Computer Graphics and Multimedia *
* All rights reserved. *
* www.openflipper.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenFlipper. *
*---------------------------------------------------------------------------*
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright notice, *
* this list of conditions and the following disclaimer. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in the *
* documentation and/or other materials provided with the distribution. *
* *
* 3. Neither the name of the copyright holder nor the names of its *
* contributors may be used to endorse or promote products derived from *
* this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
* *
\*===========================================================================*/
#include <pybind11/include/pybind11/pybind11.h>
#include <pybind11/include/pybind11/numpy.h>
#include <QString>
namespace py = pybind11;
namespace pybind11 { namespace detail {
template <> struct type_caster<QString> {
public:
/**
* This macro establishes the name 'str' in
* function signatures and declares a local variable
* 'value' of type QVariant
*/
PYBIND11_TYPE_CASTER(QString, _("str"));
/**
* Conversion part 1 (Python->C++): convert a PyObject into a QString
* instance or return false upon failure. The second argument
* indicates whether implicit conversions should be applied.
*/
bool load(handle src, bool ) {
/* Extract PyObject from handle */
PyObject *source = src.ptr();
if (!PyUnicode_Check(source))
return false;
Py_ssize_t size;
const char *ptr = PyUnicode_AsUTF8AndSize(source, &size);
if (!ptr) {
return NULL;
}
/* Now try to convert into a C++ int */
value = QString::fromUtf8(ptr, size);
/* Ensure return code was OK (to avoid out-of-range errors etc) */
return ( !PyErr_Occurred() );
}
/**
* Conversion part 2 (C++ -> Python): convert an QString instance into
* a Python object. The second and third arguments are used to
* indicate the return value policy and parent object (for
* ``return_value_policy::reference_internal``) and are generally
* ignored by implicit casters.
*/
static handle cast(QString src, return_value_policy /* policy */, handle /* parent */) {
return (PyUnicode_FromString( src.toUtf8().data()) );
}
};
}} // namespace pybind11::detail
namespace pybind11 { namespace detail {
template <> struct type_caster<Vector> {
public:
/**
* This macro establishes the name 'str' in
* function signatures and declares a local variable
* 'value' of type QVariant
*/
PYBIND11_TYPE_CASTER(Vector, _("Vector"));
/**
* Conversion part 1 (Python->C++): convert a PyObject into a Vector
* instance or return false upon failure. The second argument
* indicates whether implicit conversions should be applied.
*/
bool load(handle src, bool ) {
/* Extract PyObject from handle */
PyObject* source = src.ptr();
if ( PyList_Check(source) ) {
if ( PyList_Size(source) != 3) {
PyErr_SetString(PyExc_RuntimeError, "Vector Conversion: List size should be 3!");
throw py::error_already_set();
return false;
}
/* Now try to convert into a C++ int */
value = Vector(PyFloat_AsDouble(PyList_GetItem(source,0)),PyFloat_AsDouble(PyList_GetItem(source,1)),PyFloat_AsDouble(PyList_GetItem(source,2)));
} else if ( PyTuple_Check(source) ) {
if ( PyTuple_Size(source) != 3) {
PyErr_SetString(PyExc_RuntimeError, "Vector Conversion: Tuple size should be 3!");
throw py::error_already_set();
return false;
}
/* Now try to convert into a C++ int */
value = Vector(PyFloat_AsDouble(PyTuple_GetItem(source,0)),PyFloat_AsDouble(PyTuple_GetItem(source,1)),PyFloat_AsDouble(PyTuple_GetItem(source,2)));
} else {
PyErr_SetString(PyExc_RuntimeError, "Vector Conversion: Not a list or a tuple.");
throw py::error_already_set();
return false;
}
/* Ensure return code was OK (to avoid out-of-range errors etc) */
return ( !PyErr_Occurred() );
}
/**
* Conversion part 2 (C++ -> Python): convert an Vector instance into
* a Python object. The second and third arguments are used to
* indicate the return value policy and parent object (for
* ``return_value_policy::reference_internal``) and are generally
* ignored by implicit casters.
*/
static handle cast(Vector src, return_value_policy /* policy */, handle /* parent */) {
return PyTuple_Pack(3, PyFloat_FromDouble(src[0]),PyFloat_FromDouble(src[1]),PyFloat_FromDouble(src[2]));
}
};
}} // namespace pybind11::detail
......@@ -279,6 +279,7 @@ macro (acg_drop_templates list)
foreach (_file ${${list}})
if (_file MATCHES "T.cc$")
set_source_files_properties(${_file} PROPERTIES HEADER_FILE_ONLY TRUE)
message("Deprecated naming scheme! The file ${_file} ends with T.cc indicating it is a template only implementation file. Please rename to T_impl.hh to avoid problems with several IDEs.")
endif ()
endforeach ()
endmacro ()
......
......@@ -39,6 +39,9 @@ if ( WIN32 )
endif()
endforeach()
# Support large obj files (only costs compatibility with <MSVC 2005 linkers)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
endif( WIN32 )
if (UNIX)
......
......@@ -383,6 +383,6 @@ class DLLEXPORT BaseObjectData : public BaseObject
#if defined(INCLUDE_TEMPLATES) && !defined(BASEOBJECTDATA_C)
#define BASEOBJECT_TEMPLATES
#include "BaseObjectDataT.cc"
#include "BaseObjectDataT_impl.hh"
#endif
......@@ -122,7 +122,7 @@ private:
//=============================================================================
#if defined(INCLUDE_TEMPLATES) && !defined(OBJECTIDPOINTERMANAGERT_C)
#define OBJECTIDPOINTERMANAGERT_TEMPLATES
#include "ObjectIDPointerManagerT.cc"
#include "ObjectIDPointerManagerT_impl.hh"
#endif
......@@ -105,9 +105,6 @@ acg_append_files (qrc "*.qrc" ${directories} .)
source_group(TREE ${CMAKE_SOURCE_DIR} FILES ${sources} ${headers} ${ui-files} ${qrc})
# remove template cc files from source file list
acg_drop_templates (sources)
if (QT5_FOUND)
acg_add_library (ACG SHARED ${sources} ${headers} ${qrc})
endif()
......@@ -158,7 +155,7 @@ if (GTEST_FOUND)
file(GLOB_RECURSE TEST_SOURCES tests/*.cc)
set(TESTED_SOURCES
Algorithm/DBSCANT.cc
Algorithm/DBSCANT_impl.hh
)
include_directories(${GTEST_INCLUDE_DIRS} ${OPENMESH_INCLUDE_DIR})
link_directories ( ${GTEST_LIBRARY_DIR})
......
......@@ -1111,7 +1111,7 @@ private:
//=============================================================================
#if defined(INCLUDE_TEMPLATES) && !defined(ACG_DRAW_MESH_TCC)
#define ACG_DRAW_MESH_TEMPLATES
#include "DrawMeshT.cc"
#include "DrawMeshT_impl.hh"
#endif
//=============================================================================
#endif // ACG_DRAW_MESH_HH defined
......
......@@ -925,7 +925,12 @@ void IRenderer::bindObjectUniforms( ACG::RenderObject* _obj, GLSL::Program* _pro
_prog->setUniform("g_cAmbient", _obj->ambient);
_prog->setUniform("g_cSpecular", _obj->specular);
ACG::Vec4f materialParams(_obj->shininess, _obj->alpha, 0.0f, 0.0f);
float alphaRef = 0.f;
if (_obj->alphaTest && _obj->alphaFunc == GL_GREATER) {
alphaRef = _obj->alphaRef;
}
ACG::Vec4f materialParams(_obj->shininess, _obj->alpha, alphaRef, 0.0f);
_prog->setUniform("g_vMaterial", materialParams);
_prog->setUniform("g_cLightModelAmbient", globalLightModelAmbient_);
......
......@@ -189,6 +189,7 @@ void RenderObject::setMaterial( const SceneGraph::Material* _mat )
// material node sets the alpha test function to GL_GREATER
alphaFunc = GL_GREATER;
alphaTest = _mat->alphaTest();
alphaRef = _mat->alphaValue();
}
......
......@@ -1073,6 +1073,7 @@ void ShaderProgGenerator::initGenDefines(ShaderGenerator* _gen)
}
_gen->addDefine("SG_ALPHA g_vMaterial.y");
_gen->addDefine("SG_MINALPHA g_vMaterial.z");
_gen->addMacros(desc_.macros);
......@@ -1182,7 +1183,11 @@ void ShaderProgGenerator::addVertexBeginCode(QStringList* _code)
_code->push_back("vec3 sg_vNormalOS = vec3(0.0, 1.0, 0.0);");
if (desc_.vertexColors && (desc_.colorMaterialMode == GL_AMBIENT || desc_.colorMaterialMode == GL_AMBIENT_AND_DIFFUSE))
_code->push_back(QString("vec4 sg_cColor = vec4(g_cEmissive + g_cLightModelAmbient * ") + ShaderGenerator::keywords.macro_inputVertexColor + QString(".xyz, SG_ALPHA);"));
_code->push_back(QString("vec4 sg_cColor = vec4(g_cEmissive + g_cLightModelAmbient * ")
+ ShaderGenerator::keywords.macro_inputVertexColor
+ QString(".rgb, SG_ALPHA * ")
+ ShaderGenerator::keywords.macro_inputVertexColor
+ QString(".a);"));
else
_code->push_back("vec4 sg_cColor = vec4(g_cEmissive + g_cLightModelAmbient * g_cAmbient, SG_ALPHA);");
......@@ -1817,7 +1822,11 @@ void ShaderProgGenerator::addFragmentBeginCode(QStringList* _code)
if (desc_.vertexColors && (desc_.colorMaterialMode == GL_AMBIENT || desc_.colorMaterialMode == GL_AMBIENT_AND_DIFFUSE))
_code->push_back(QString("vec4 sg_cColor = vec4(g_cEmissive + g_cLightModelAmbient * ") + ShaderGenerator::keywords.macro_inputVertexColor + QString(".xyz, SG_ALPHA);"));
_code->push_back(QString("vec4 sg_cColor = vec4(g_cEmissive + g_cLightModelAmbient * ")
+ ShaderGenerator::keywords.macro_inputVertexColor
+ QString(".rgb, SG_ALPHA * ")
+ ShaderGenerator::keywords.macro_inputVertexColor
+ QString(".a);"));
else
_code->push_back("vec4 sg_cColor = vec4(g_cEmissive + g_cLightModelAmbient * g_cAmbient, SG_ALPHA);");
......@@ -1826,6 +1835,7 @@ void ShaderProgGenerator::addFragmentBeginCode(QStringList* _code)
(ioDesc_.passColor_ && (desc_.shadeMode == SG_SHADE_UNLIT || desc_.colorMaterialMode == GL_EMISSION)))
_code->push_back(QString("sg_cColor = ") + ShaderGenerator::keywords.macro_inputVertexColor + QString(";"));
_code->push_back(QString("if (sg_cColor.a < SG_MINALPHA) discard;"));
if (desc_.shadeMode == SG_SHADE_PHONG)
addLightingCode(_code);
......
......@@ -133,7 +133,7 @@ degToRad( const ValueT& _angle );
//=============================================================================
#if defined(INCLUDE_TEMPLATES) && !defined(ALGORITHMSANGLE_C)
#define ALGORITHMSANGLE_TEMPLATES
#include "AlgorithmsAngleT.cc"
#include "AlgorithmsAngleT_impl.hh"
#endif
//=============================================================================
#endif // ALGORITHMSANGLE_HH defined
......
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (c) 2001-2015, RWTH-Aachen University *
* Department of Computer Graphics and Multimedia *
* All rights reserved. *
* www.openflipper.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenFlipper. *
*---------------------------------------------------------------------------*
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright notice, *
* this list of conditions and the following disclaimer. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in the *
* documentation and/or other materials provided with the distribution. *
* *
* 3. Neither the name of the copyright holder nor the names of its *
* contributors may be used to endorse or promote products derived from *
* this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
* *
\*===========================================================================*/
#include "PlaneType.hh"
namespace ACG {
namespace Geometry {
void Plane::setPlane(const ACG::Vec3d& _position, const ACG::Vec3d& _xDirection, const ACG::Vec3d& _yDirection)
{
position = _position;
xDirection = _xDirection;
yDirection = _yDirection;
normal = (_xDirection % _yDirection).normalize();
}
//----------------------------------------------------------------
void Plane::setPlane(const ACG::Vec3d& _position, const ACG::Vec3d& _normal)
{
//find a non zero component
int comp = -1;
for (int i=0; i < 3; i++)
if ( _normal[i] != 0.0 ){
comp = i;
break;
}
if (comp == -1){
std::cerr << "PlaneNode: normal is invalid!" << std::endl;
return;
}
//compute orthogonal vectors in the plane
xDirection[comp] = (-_normal[ (comp + 1) % 3 ] - _normal[(comp + 2) % 3]) / _normal[comp];
xDirection[ (comp + 1) % 3 ] = 1;
xDirection[ (comp + 2) % 3 ] = 1;
xDirection = xDirection.normalize();
yDirection = _normal % xDirection;
yDirection = yDirection.normalize();
position = _position;
normal = _normal;
}
//----------------------------------------------------------------
void Plane::transform(const ACG::Matrix4x4d& _mat)
{
position = _mat.transform_point(position);
xDirection = _mat.transform_vector(xDirection);
yDirection = _mat.transform_vector(yDirection);
normal = (xDirection % yDirection).normalize();
}
//----------------------------------------------------------------
void Plane::setSize(double _xDirection, double _yDirection)
{
xDirection = xDirection.normalize() * _xDirection;
yDirection = yDirection.normalize() * _yDirection;
}
}} // namespaces
//=============================================================================
#pragma once
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (c) 2001-2015, RWTH-Aachen University *
* Department of Computer Graphics and Multimedia *
* All rights reserved. *
* www.openflipper.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenFlipper. *
*---------------------------------------------------------------------------*
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright notice, *
* this list of conditions and the following disclaimer. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in the *
* documentation and/or other materials provided with the distribution. *
* *
* 3. Neither the name of the copyright holder nor the names of its *
* contributors may be used to endorse or promote products derived from *
* this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
* *
\*===========================================================================*/
#include <ACG/Math/Matrix4x4T.hh>
#include <ACG/Math/VectorT.hh>
#include <ACG/Config/ACGDefines.hh>
namespace ACG {
namespace Geometry {
class ACGDLLEXPORT Plane {
public:
Plane() {}
Plane(const ACG::Vec3d& _p, const ACG::Vec3d& _n, const ACG::Vec3d& _x, const ACG::Vec3d& _y) :
position(_p), normal(_n), xDirection(_x), yDirection(_y) {
}
/** \brief Set plane
*
* @param _position One point on the plane. Will be used as corner point point for rendering in the PlaneNode
* @param _xDirection Vector pointing in planes x direction
* @param _yDirection Vector pointing in planes y direction
*/
void setPlane(const ACG::Vec3d& _position, const ACG::Vec3d& _xDirection, const ACG::Vec3d& );
/** \brief Set plane with given normal and one point
*
* @param _position One point on the plane. Will be used as corner point for rendering in the PlaneNode
* @param _normal Plane normal
*/
void setPlane(const ACG::Vec3d & _position, const ACG::Vec3d & _normal);
/** \brief Set plane size
*
* Scales the plane such that the x and y direction vectors have the given lengths
*
* @param _xDirection Size in x direction
* @param _yDirection Size in y direction
*/
void setSize(double _xDirection, double _yDirection);
/** \brief Transform the plane with given matrix
*
*
* @param _mat Transformation matrix.
*/
void transform(const ACG::Matrix4x4d & _mat);
public:
ACG::Vec3d position;
ACG::Vec3d normal;
ACG::Vec3d xDirection;
ACG::Vec3d yDirection;
};
}} // namespaces
......@@ -213,7 +213,7 @@ private: //---------------------------------------------------------------------
//=============================================================================
#if defined(OM_INCLUDE_TEMPLATES) && !defined(BSPIMPLT_C)
# define BSPIMPLT_TEMPLATES
# include "BSPImplT.cc"
# include "BSPImplT_impl.hh"
#endif
//=============================================================================
#endif // BSPIMPLT_HH defined
......
......@@ -158,7 +158,7 @@ protected: //-------------------------------------------------------------------
//=============================================================================
#if defined(OM_INCLUDE_TEMPLATES) && !defined(TRIANGLEBSPCORET_C)
# define TRIANGLEBSPCORET_TEMPLATES
# include "TriangleBSPCoreT.cc"
# include "TriangleBSPCoreT_impl.hh"
#endif
//=============================================================================
#endif // TRIANGLEBSPCORET_HH defined
......
......@@ -189,7 +189,7 @@ typedef DualQuaternionT<double> DualQuaterniond;