23 JsonRPCPlugin::JsonRPCPlugin(QObject* parent)
32 QList<QAction*> JsonRPCPlugin::getActions() {
38 m_action =
new QAction(
getName(),
this);
41 m_action->setCheckable(
true);
42 m_action->setChecked(
false);
43 m_action->setEnabled(
true);
53 qDebug() <<
"JsonRPCPlugin::triggered " << checked;
63 QMap<QString, QVariant>
params) {
64 qDebug() << method <<
params;
65 if (
m_app ==
nullptr) {
70 bool need_redraw =
false;
71 if (method ==
"open") {
76 bool loadCoordinatesTransEnabled =
false;
88 if (
params.contains(
"silent")) {
107 QList<QVariant> transformation =
params[
"transformation"].toList();
108 if (transformation.size() == 4 * 4) {
109 std::vector<double> values(4 * 4);
111 for (
unsigned i = 0; i < 4 * 4; ++i) {
112 double d = transformation[i].toDouble(&success);
113 qDebug() << transformation[i].toString()
114 << transformation[i].toDouble();
118 values[((i % 4) * 4) + (i / 4)] = d;
122 qDebug() <<
"apply matrix: " << mat.
toString();
134 }
else if (method ==
"clear") {
138 while ((child = root->
getChild(0)) !=
nullptr) {
CC_FILE_ERROR
Typical I/O filter errors.
cmdLineReadable * params[]
static bool PrintDebug(const char *format,...)
Same as Print, but works only in Debug mode.
static ccHObject * LoadFromFile(const QString &filename, LoadParameters ¶meters, Shared filter, CC_FILE_ERROR &result)
Loads one or more entities from a file with a known filter.
JsonRPCResult execute(QString method, QMap< QString, QVariant > params)
void triggered(bool checked)
JsonRPCResult execute(QString method, QMap< QString, QVariant > params)
void listen(unsigned int port)
virtual QString getName() const override
Returns (short) name (for menu entry, etc.)
virtual QString getDescription() const override
Returns long name/description (for tooltip, etc.)
virtual QIcon getIcon() const override
Returns icon.
virtual void setGLTransformation(const ccGLMatrix &trans)
Associates entity with a GL transformation (rotation + translation)
QString toString(int precision=12, QChar separator=' ') const
Returns matrix as a string.
Float version of ccGLMatrixTpl.
A 3D cloud interface with associated features (color, normals, octree, etc.)
Hierarchical CLOUDVIEWER Object.
void applyGLTransformation_recursive(const ccGLMatrix *trans=nullptr)
Applies the active OpenGL transformation to the entity (recursive)
unsigned filterChildren(Container &filteredChildren, bool recursive=false, CV_CLASS_ENUM filter=CV_TYPES::OBJECT, bool strict=false) const
Collects the children corresponding to a certain pattern.
std::vector< ccHObject * > Container
Standard instances container (for children, etc.)
ccHObject * getChild(unsigned childPos) const
Returns the ith child.
Standard ECV plugin interface.
ecvMainAppInterface * m_app
Main application interface.
virtual ccHObject * dbRootObject()=0
Returns DB root (as a ccHObject)
virtual QWidget * getActiveWindow()=0
virtual void addToDB(ccHObject *obj, bool updateZoom=false, bool autoExpandDBTree=true, bool checkDimensions=false, bool autoRedraw=true)=0
virtual void removeFromDB(ccHObject *obj, bool autoDelete=true)=0
Removes an entity from main db tree.
std::string toString(T x)
Generic loading parameters.
CCVector3d * coordinatesShift
If applicable, applied shift on load (optional)
ecvGlobalShiftManager::Mode shiftHandlingMode
How to handle big coordinates.
QWidget * parentWidget
Parent widget (if any)
bool alwaysDisplayLoadDialog
bool * coordinatesShiftEnabled
Whether shift on load has been applied after loading (optional)
static JsonRPCResult success(QVariant value)
static JsonRPCResult error(int code, QString message)