Commit bb7ea319 authored by Hossain Mahmud's avatar Hossain Mahmud
Browse files

rebased :)

parent 9cf13bed
......@@ -225,7 +225,7 @@ namespace campvis {
_mainLayout->addWidget(_infoWidget, 0, 1, 3, 1);
qRegisterMetaType<QtDataHandle>("QtDataHandle");
qRegisterMetaType<cgt::vec4>("tgt_vec4");
qRegisterMetaType<cgt::vec4>("cgt_vec4");
connect(
_dctWidget->selectionModel(), SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)),
this, SLOT(onDCTWidgetSelectionModelSelectionChanged(const QItemSelection&, const QItemSelection&)));
......
......@@ -121,10 +121,6 @@ namespace campvis {
%template(IntProperty) NumericProperty< int >;
typedef NumericProperty< int > IntProperty;
%template(Ivec2GenericProperty) GenericProperty< tgt::Vector2<int> >;
%template(IVec2Property) NumericProperty< tgt::Vector2<int> >;
typedef NumericProperty< tgt::Vector2<int> > IVec2Property;
%template(Ivec2GenericProperty) GenericProperty< cgt::Vector2<int> >;
%template(IVec2Property) NumericProperty< cgt::Vector2<int> >;
typedef NumericProperty< cgt::Vector2<int> > IVec2Property;
......@@ -311,14 +307,14 @@ namespace campvis {
campvis::IntProperty, campvis::IVec2Property, campvis::IVec3Property, campvis::IVec4Property,
campvis::FloatProperty, campvis::Vec2Property, campvis::Vec3Property, campvis::Vec4Property,
campvis::TransferFunctionProperty,
campvis::DataNameProperty, campvis::StringProperty, campvis::ButtonProperty, campvis::BoolProperty, campvis::CameraProperty);
campvis::DataNameProperty, campvis::StringProperty, campvis::ButtonProperty, campvis::BoolProperty);
/* Downcast the return value of HasPropertyCollection::getNestedProperty to appropriate subclass */
%factory(AbstractProperty* campvis::HasPropertyCollection::getNestedProperty,
campvis::IntProperty, campvis::IVec2Property, campvis::IVec3Property, campvis::IVec4Property,
campvis::FloatProperty, campvis::Vec2Property, campvis::Vec3Property, campvis::Vec4Property,
campvis::TransferFunctionProperty,
campvis::DataNameProperty, campvis::StringProperty, campvis::ButtonProperty, campvis::BoolProperty, campvis::CameraProperty);
campvis::DataNameProperty, campvis::StringProperty, campvis::ButtonProperty, campvis::BoolProperty);
/* HasPropertyCollection */
......
......@@ -277,15 +277,6 @@ namespace campvis {
return nullptr;
}
AbstractProcessor* AbstractPipeline::getProcessor(const std::string& name) const {
for (auto it = _processors.begin(); it != _processors.end(); ++it) {
if ((*it)->getName() == name)
return *it;
}
return nullptr;
}
AbstractProcessor* AbstractPipeline::getProcessor( int index ) const {
if (index < 0 || index >= _processors.size())
return nullptr;
......
......@@ -160,17 +160,17 @@ vec3 Camera::project(ivec2 vp, vec3 point) const {
GLdouble modelview[16];
GLdouble projection[16];
cgt::mat4 projection_tgt = getProjectionMatrix();
cgt::mat4 modelview_tgt = getViewMatrix();
cgt::mat4 projection_cgt = getProjectionMatrix();
cgt::mat4 modelview_cgt = getViewMatrix();
for (int i = 0; i < 4; ++i) {
modelview[i+0] = modelview_tgt[i].x;
modelview[i+4] = modelview_tgt[i].y;
modelview[i+8] = modelview_tgt[i].z;
modelview[i+12] = modelview_tgt[i].w;
projection[i+0] = projection_tgt[i].x;
projection[i+4] = projection_tgt[i].y;
projection[i+8] = projection_tgt[i].z;
projection[i+12] = projection_tgt[i].w;
modelview[i+0] = modelview_cgt[i].x;
modelview[i+4] = modelview_cgt[i].y;
modelview[i+8] = modelview_cgt[i].z;
modelview[i+12] = modelview_cgt[i].w;
projection[i+0] = projection_cgt[i].x;
projection[i+4] = projection_cgt[i].y;
projection[i+8] = projection_cgt[i].z;
projection[i+12] = projection_cgt[i].w;
}
viewport[0] = 0;
viewport[1] = 0;
......
......@@ -19,7 +19,7 @@ namespace campvis {
};
class MicroscopyImageSegmentation : public VisualizationProcessor, public HasProcessorDecorators, public tgt::EventListener {
class MicroscopyImageSegmentation : public VisualizationProcessor, public HasProcessorDecorators, public cgt::EventListener {
public:
MicroscopyImageSegmentation(campvis::IVec2Property* viewportSizeProp, campvis::RaycastingProcessor* raycaster);
virtual ~MicroscopyImageSegmentation();
......
......@@ -127,7 +127,8 @@ ADD_LIBRARY(campvis-scripting ${CampvisSharedStaticModulesFix}
)
ADD_DEPENDENCIES(campvis-scripting ${CampvisLuaModules})
TARGET_LINK_LIBRARIES(campvis-scripting campvis-core campvis-modules tgt ${CampvisGlobalExternalLibs})
TARGET_LINK_LIBRARIES(campvis-scripting campvis-core campvis-modules cgt ${CampvisGlobalExternalLibs})
TARGET_LINK_LIBRARIES(campvis-scripting campvis-core campvis-modules cgt ${CampvisGlobalExternalLibs})
IF(CAMPVIS_GROUP_SOURCE_FILES)
DEFINE_SOURCE_GROUPS_FROM_SUBDIR(CampvisScriptingSources ${CampvisHome} "")
......
......@@ -27,10 +27,10 @@
#include "core/tools/stringutils.h"
namespace campvis {
CameraPropertyLua::CameraPropertyLua(CameraProperty* property, DataContainer* dataContainer)
: AbstractPropertyLua(property, true, dataContainer)
{
}
//CameraPropertyLua::CameraPropertyLua(CameraProperty* property, DataContainer* dataContainer)
// : AbstractPropertyLua(property, true, dataContainer)
//{
//}
CameraPropertyLua::~CameraPropertyLua() {
}
......@@ -45,28 +45,28 @@ namespace campvis {
std::string CameraPropertyLua::getLuaScript(std::string prefix) {
std::string ret = "";
tgt::Camera cam = static_cast<CameraProperty*>(_property)->getValue();
tgt::vec3 pos = cam.getPosition();
tgt::vec3 focus = cam.getFocus();
tgt::vec3 up = cam.getUpVector();
float fovy = cam.getFovy();
float ratio = cam.getRatio();
float distn = cam.getNearDist();
float distf = cam.getFarDist();
int pm = cam.getProjectionMode();
// cgt::Camera cam = static_cast<CameraProperty*>(_property)->getValue();
// cgt::vec3 pos = cam.getPosition();
// cgt::vec3 focus = cam.getFocus();
// cgt::vec3 up = cam.getUpVector();
// float fovy = cam.getFovy();
// float ratio = cam.getRatio();
// float distn = cam.getNearDist();
// float distf = cam.getFarDist();
// int pm = cam.getProjectionMode();
ret += "getNestedProperty(\"" + prefix+ _property->getName() + "\"):setValue(tgt.Camera("
+ "tgt.vec3(" + StringUtils::toString(pos.x) + "," + StringUtils::toString(pos.y) + "," + StringUtils::toString(pos.z) + ")"
+ "," + "tgt.vec3(" + StringUtils::toString(focus.x) + "," + StringUtils::toString(focus.y) + "," + StringUtils::toString(focus.z) + ")"
+ "," + "tgt.vec3(" + StringUtils::toString(up.x) + "," + StringUtils::toString(up.y) + "," + StringUtils::toString(up.z) + ")"
+ "," + StringUtils::toString(fovy)
+ "," + StringUtils::toString(ratio)
+ "," + StringUtils::toString(distn)
+ "," + StringUtils::toString(distf)
+ "," + StringUtils::toString(pm)
+"))";
// ret += "getNestedProperty(\"" + prefix+ _property->getName() + "\"):setValue(cgt.Camera("
// + "cgt.vec3(" + StringUtils::toString(pos.x) + "," + StringUtils::toString(pos.y) + "," + StringUtils::toString(pos.z) + ")"
// + "," + "cgt.vec3(" + StringUtils::toString(focus.x) + "," + StringUtils::toString(focus.y) + "," + StringUtils::toString(focus.z) + ")"
// + "," + "cgt.vec3(" + StringUtils::toString(up.x) + "," + StringUtils::toString(up.y) + "," + StringUtils::toString(up.z) + ")"
// + "," + StringUtils::toString(fovy)
// + "," + StringUtils::toString(ratio)
// + "," + StringUtils::toString(distn)
// + "," + StringUtils::toString(distf)
// + "," + StringUtils::toString(pm)
// +"))";
//ret = "-- If required need to implement lua interface for tgt:Camera";
// //ret = "-- If required need to implement lua interface for cgt:Camera";
return ret;
}
......
......@@ -27,9 +27,7 @@
#include "abstractpropertylua.h"
#include "propertyluafactory.h"
#include "core/properties/cameraproperty.h"
class QLabel;
//#include "core/properties/cameraproperty.h"
namespace campvis {
/**
......@@ -44,7 +42,7 @@ namespace campvis {
* \param dataContainer DataContainer to use (optional), defaults to nullptr.
* \param parent Parent Qt lua
*/
CameraPropertyLua(CameraProperty* property, DataContainer* dataContainer);
//CameraPropertyLua(CameraProperty* property, DataContainer* dataContainer);
/**
* Destructor
......@@ -53,16 +51,10 @@ namespace campvis {
std::string getLuaScript(std::string prefix);
private:
QLabel* _lblCameraPosition;
QLabel* _lblFocusPosition;
QLabel* _lblLookDirection;
QLabel* _lblUpVector;
};
// explicitly instantiate template, so that it gets registered also over DLL boundaries.
template class PropertyLuaRegistrar<CameraPropertyLua, CameraProperty>;
//template class PropertyLuaRegistrar<CameraPropertyLua, CameraProperty>;
}
#endif // CAMERAPROPERTYLUA_H__
......
......@@ -36,9 +36,9 @@ namespace campvis {
}
std::string ColorPropertyLua::getLuaScript(std::string prefix) {
tgt::vec4 value = static_cast<ColorProperty*>(_property)->getValue();
cgt::vec4 value = static_cast<ColorProperty*>(_property)->getValue();
std::string ret = "";
ret += "getNestedProperty(\"" + prefix + _property->getName() + "\"):setValue(tgt.vec4("
ret += "getNestedProperty(\"" + prefix + _property->getName() + "\"):setValue(cgt.vec4("
+ StringUtils::toString(value.x) +", " + StringUtils::toString(value.y) +", "
+ StringUtils::toString(value.z) +", " + StringUtils::toString(value.w) + "))";
return ret;
......
......@@ -65,19 +65,19 @@ namespace campvis {
template<>
struct VecPropertyLuaTraits<2> {
typedef Vec2Property PropertyType;
typedef tgt::vec2 BaseType;
typedef cgt::vec2 BaseType;
};
template<>
struct VecPropertyLuaTraits<3> {
typedef Vec3Property PropertyType;
typedef tgt::vec3 BaseType;
typedef cgt::vec3 BaseType;
};
template<>
struct VecPropertyLuaTraits<4> {
typedef Vec4Property PropertyType;
typedef tgt::vec4 BaseType;
typedef cgt::vec4 BaseType;
};
}
......@@ -139,9 +139,9 @@ namespace campvis {
}
std::string campvis::Vec2PropertyLua::getLuaScript(std::string prefix) {
tgt::vec2 value = static_cast<Vec2Property*>(_property)->getValue();
cgt::vec2 value = static_cast<Vec2Property*>(_property)->getValue();
std::string ret = "";
ret += "getNestedProperty(\"" + prefix + _property->getName() + "\"):setValue(tgt.vec2("
ret += "getNestedProperty(\"" + prefix + _property->getName() + "\"):setValue(cgt.vec2("
+ StringUtils::toString(value.x) +", " + StringUtils::toString(value.y) + "))";
return ret;
}
......@@ -156,9 +156,9 @@ namespace campvis {
{
}
std::string campvis::Vec3PropertyLua::getLuaScript(std::string prefix) {
tgt::vec3 value = static_cast<Vec3Property*>(_property)->getValue();
cgt::vec3 value = static_cast<Vec3Property*>(_property)->getValue();
std::string ret = "";
ret += "getNestedProperty(\"" + prefix + _property->getName() + "\"):setValue(tgt.vec3("
ret += "getNestedProperty(\"" + prefix + _property->getName() + "\"):setValue(cgt.vec3("
+ StringUtils::toString(value.x) +", " + StringUtils::toString(value.y)
+", " + StringUtils::toString(value.z) + "))";
return ret;
......@@ -175,9 +175,9 @@ namespace campvis {
}
std::string campvis::Vec4PropertyLua::getLuaScript(std::string prefix) {
tgt::vec4 value = static_cast<Vec4Property*>(_property)->getValue();
cgt::vec4 value = static_cast<Vec4Property*>(_property)->getValue();
std::string ret = "";
ret += "getNestedProperty(\"" + prefix + _property->getName() + "\"):setValue(tgt.vec4("
ret += "getNestedProperty(\"" + prefix + _property->getName() + "\"):setValue(cgt.vec4("
+ StringUtils::toString(value.x) +", " + StringUtils::toString(value.y) +", "
+ StringUtils::toString(value.z) +", " + StringUtils::toString(value.w) + "))";
return ret;
......
......@@ -64,19 +64,19 @@ namespace campvis {
template<>
struct IVecPropertyLuaTraits<2> {
typedef IVec2Property PropertyType;
typedef tgt::ivec2 BaseType;
typedef cgt::ivec2 BaseType;
};
template<>
struct IVecPropertyLuaTraits<3> {
typedef IVec3Property PropertyType;
typedef tgt::ivec3 BaseType;
typedef cgt::ivec3 BaseType;
};
template<>
struct IVecPropertyLuaTraits<4> {
typedef IVec4Property PropertyType;
typedef tgt::ivec4 BaseType;
typedef cgt::ivec4 BaseType;
};
}
......@@ -137,9 +137,9 @@ namespace campvis {
}
std::string campvis::IVec2PropertyLua::getLuaScript(std::string prefix) {
tgt::ivec2 value = static_cast<IVec2Property*>(_property)->getValue();
cgt::ivec2 value = static_cast<IVec2Property*>(_property)->getValue();
std::string ret = "";
ret += "getNestedProperty(\"" + prefix + _property->getName() + "\"):setValue(tgt.ivec2("
ret += "getNestedProperty(\"" + prefix + _property->getName() + "\"):setValue(cgt.ivec2("
+ StringUtils::toString(value.x) +", " + StringUtils::toString(value.y) + "))";
return ret;
}
......@@ -155,9 +155,9 @@ namespace campvis {
}
std::string campvis::IVec3PropertyLua::getLuaScript(std::string prefix) {
tgt::ivec3 value = static_cast<IVec3Property*>(_property)->getValue();
cgt::ivec3 value = static_cast<IVec3Property*>(_property)->getValue();
std::string ret = "";
ret += "getNestedProperty(\"" + prefix + _property->getName() + "\"):setValue(tgt.ivec3("
ret += "getNestedProperty(\"" + prefix + _property->getName() + "\"):setValue(cgt.ivec3("
+ StringUtils::toString(value.x) +", " + StringUtils::toString(value.y) +", "
+ StringUtils::toString(value.z) + "))";
return ret;
......@@ -174,9 +174,9 @@ namespace campvis {
}
std::string campvis::IVec4PropertyLua::getLuaScript(std::string prefix) {
tgt::ivec4 value = static_cast<IVec4Property*>(_property)->getValue();
cgt::ivec4 value = static_cast<IVec4Property*>(_property)->getValue();
std::string ret = "";
ret += "getNestedProperty(\"" + prefix + _property->getName() + "\"):setValue(tgt.ivec4("
ret += "getNestedProperty(\"" + prefix + _property->getName() + "\"):setValue(cgt.ivec4("
+ StringUtils::toString(value.x) +", " + StringUtils::toString(value.y) +", "
+ StringUtils::toString(value.z) +", " + StringUtils::toString(value.w) + "))";
return ret;
......
......@@ -22,7 +22,7 @@
//
// ================================================================================================
#include "tgt/assert.h"
#include "cgt/assert.h"
#include "metapropertylua.h"
#include "core/tools/stringutils.h"
......
......@@ -59,7 +59,7 @@ namespace campvis {
_propertyWidgetMap.insert(it, std::make_pair(typeIndex, ptr));
}
else {
tgtAssert(false, "Double-registered a property widget for the same type.");
cgtAssert(false, "Double-registered a property widget for the same type.");
}
}
if (fallbackPtr != nullptr) {
......
......@@ -25,8 +25,8 @@
#ifndef PROPERTYLUAFACTORY_H__
#define PROPERTYLUAFACTORY_H__
#include "tgt/logmanager.h"
#include "tgt/singleton.h"
#include "cgt/logmanager.h"
#include "cgt/singleton.h"
#include <tbb/atomic.h>
#include <tbb/spin_mutex.h>
......@@ -123,7 +123,7 @@ namespace campvis {
* \return The newly created property widget.
*/
static AbstractPropertyLua* create(AbstractProperty* property, DataContainer* dc = nullptr) {
tgtAssert(dynamic_cast<PropertyType*>(property) != nullptr, "Incompatible types - this should not happen!");
cgtAssert(dynamic_cast<PropertyType*>(property) != nullptr, "Incompatible types - this should not happen!");
return new PropertyLuaType(static_cast<PropertyType*>(property), dc);
}
......
......@@ -39,10 +39,10 @@ namespace campvis {
std::string TransferFunctionPropertyLua::getLuaScript(std::string prefix) {
TransferFunctionProperty* prop = static_cast<TransferFunctionProperty*>(_property);
AbstractTransferFunction* tf = prop->getTF();
const tgt::vec2& domain = tf->getIntensityDomain();
const cgt::vec2& domain = tf->getIntensityDomain();
std::string ret = "";
ret += "getNestedProperty(\"" + prefix + _property->getName() + "\"):setIntensityDomain(tgt.vec2("
ret += "getNestedProperty(\"" + prefix + _property->getName() + "\"):setIntensityDomain(cgt.vec2("
+ StringUtils::toString(domain.x) +", " + StringUtils::toString(domain.y) + "))";
return ret;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment