Cyclone 3DR Script
from Technodigit, part of Hexagon. Copyright 1997-2022.
 
Loading...
Searching...
No Matches
SImage.h
1
2// This file is part of the 3DReshaper technology software and is a proprietary information of TECHNODIGIT.
3// Do NOT reproduce or disclose this file without TECHNODIGIT written consent.
5
6#pragma once
7
8#include "RshPluginScript/RshPluginScriptDefines.h"
9#include "RshDisplay/SComp/SImage.h"
10#include "RshPluginScript/SClass/SCameraInternal.h"
11#include "RshPluginScript/SClass/SComp.h"
12#include <QtScript/Array>
13#include <QtScript/QScriptable>
14
15#ifndef FCT_DOC
16namespace rsh::ScriptBinding
17{
18#endif // !FCT_DOC
19
28class SImage : public SComp
29{
30 //======================================================================================================================
31 // INTERNAL FUNCTION
32 //======================================================================================================================
33 //======================================================================================================================
34 // DOCUMENTED FUNCTION
35 //======================================================================================================================
36public:
40 {
41 CONSTRAINT_NONE, // No constraint
42 CONSTRAINT_POSITION, // The position of the image is fixed
43 CONSTRAINT_ORIENTATION, // The orientation of the image is fixed
44 CONSTRAINT_INTERNAL// The internal (intrinsic) parameters of the images are fixed
45 };
46
47public slots:
48
51 String toString() ;
52
53 //-------------------------------------------------------------------------------------------------------------------
70 Array<SPoint> iCrdModel3D,
71 Array<SPoint> iCrdUVImage,
72 EstimatePoseConstraintEnum iContraints = CONSTRAINT_NONE);
73
74 //-------------------------------------------------------------------------------------------------------------------
82 Array EstimatePose( String iPath);
83
84 //-------------------------------------------------------------------------------------------------------------------
99 Array EstimatePoseFromFile( String iPath, EstimatePoseConstraintEnum iContraints = CONSTRAINT_NONE);
100
101 //---------------------------------------------------------------------------------------------------------------------
108 SPoint iPosition,
110 Number iRotation,
112 Number iPixelSize
114 );
115
116 //---------------------------------------------------------------------------------------------------------------------
126
127 //---------------------------------------------------------------------------------------------------------------------
134 SCameraExternal iExternalParams
136 );
137
138 //---------------------------------------------------------------------------------------------------------------------
146
147 //---------------------------------------------------------------------------------------------------------------------
154 SCameraInternal iInternalParams
156 );
157
165
170
174
181 // TESTED
182 Array ClearMask();
183
194 // TESTED
195 Array SetMaskFromFile( String iMaskFilePath);
196
202 // TESTED
204
207 // TESTED
208 Boolean HasMask();
209};
210
211// @brief
212// this class allow to wrap static function to SPoly easily
213// this allow to wrap constructor more easily the constructor will be declared with the function New(...)
214class SImage
215#ifndef FCT_DOC
216 : public SObjectStatic
217#endif // FCT_DOC
218{
219 //======================================================================================================================
220 // INTERNAL FUNCTION
221 //======================================================================================================================
222
223 //======================================================================================================================
224 // DOCUMENTED FUNCTION
225 //======================================================================================================================
226public:
230 {
234 ORTHO
235 };
236
237public slots:
238
242 static SImage New(
243 SImage iOther,
245 SImageType iImageType = {}
247 );
248
258 static Array ConvertTextureMapsToAtlas(SPoly ioPoly
260 );
261
273 SPoly ioPoly,
275 Number iPixelPerTriangle,
277 Boolean iIsUpdateOnlyTriWithoutTexture
279 );
280
284 static Array FromSel();
285
289 // TESTED
290 static Array FromName( String iName)
291 {
292 return SComp::GetFromName<SImage>(iName);
293 }
294
302 static Array All(Number iVisCrit = 2)
303 {
304 return SComp::GetAll<SImage>(iVisCrit);
305 }
306
309 String toString() ;
310};
311Q_DECLARE_METATYPE(SImage::_SImageDummy);
312Q_DECLARE_METATYPE(SImage);
313
314#ifndef FCT_DOC
315} // namespace rsh::ScriptBinding
316#endif // !FCT_DOC
317
318Q_DECLARE_METATYPE(rsh::ScriptBinding::SImage);
319Q_DECLARE_METATYPE(SImage::SImageType);
This class is only available if you have the Survey plugin. .
Definition: SCameraExternal.h:30
This class is only available if you have the Survey plugin. .
Definition: SCameraInternal.h:30
The SComp class is an abstract class. Use derived classes SCircle, SCylinder, SCloud,...
Definition: SComp.h:32
This class is only available if you have the Survey plugin. .
Definition: SImage.h:29
Array SetMaskFromFile(String iMaskFilePath)
Set the texture mask of the SImage from a file. File extensions authorized: .bmp, ....
Boolean HasMask()
Return if the SImage has a mask or not.
Array GoToCameraViewpoint()
Go to the camera viewpoint.
Array GetCameraInternalParameters()
Get internal camera parameters of a perspective image.
Array EstimatePose(Array< SPoint > iCrdModel3D, Array< SPoint > iCrdUVImage, EstimatePoseConstraintEnum iContraints=CONSTRAINT_NONE)
Estimate the pose of an image using reference points.
static Array ConvertColorToTexture(SPoly ioPoly, Number iPixelPerTriangle, Boolean iIsUpdateOnlyTriWithoutTexture)
Converts colors/inspections of a mesh into texture.
Array SetCameraExternalParameters(SCameraExternal iExternalParams)
Set external camera parameters for perspective and spherical images.
Array EstimatePoseFromFile(String iPath, EstimatePoseConstraintEnum iContraints=CONSTRAINT_NONE)
Estimate the pose of an image using reference points stored in a file.
Array SetOrthoParameters(SPoint iPosition, Number iRotation, Number iPixelSize)
Set ortho image parameters.
static Array FromSel()
Function to get selected images.
static Array All(Number iVisCrit=2)
Get all the SImage in the document.
Definition: SImage.h:302
Array GetImageType()
Get image type.
EstimatePoseConstraintEnum
Bitmask to know which parameters are fixed and should not be estimated.
Definition: SImage.h:40
@ CONSTRAINT_POSITION
Definition: SImage.h:42
@ CONSTRAINT_NONE
Definition: SImage.h:41
@ CONSTRAINT_ORIENTATION
Definition: SImage.h:43
Array ClearMask()
Clear the link between and image and its texture mask.
static SImage New(SImage iOther, SImageType iImageType={})
Constructs a SImage by copying the SImage Other and setting the SImageType in input....
Array SetCameraInternalParameters(SCameraInternal iInternalParams)
Set internal camera parameters for a perspective image.
Array GetOrthoParameters()
Get ortho image parameters.
SImageType
Image Type.
Definition: SImage.h:230
@ SPHERICAL
Definition: SImage.h:233
@ ABSTRACT
Definition: SImage.h:231
@ PERSPECTIVE
Definition: SImage.h:232
Array CreateMaskAuto()
Create an automatic mask from the SImage.
Array EstimatePose(String iPath)
Estimate the pose of an image using reference points stored in a file.
Array GetCameraExternalParameters()
Get external camera parameters of perspective and spherical images.
static Array FromName(String iName)
Search all the component with the given name.
Definition: SImage.h:290
static Array ConvertTextureMapsToAtlas(SPoly ioPoly)
Converts all the texture maps of a mesh into one (or several) texture atlas.
String toString()
Get the type of the variable.
3D point manipulation class. The SPoint creation can be done by calling the static functions:
Definition: SPoint.h:23
The SPoly class provides triangular mesh(es) manipulation. The SPoly creation can be done by calling ...
Definition: SPoly.h:39