ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ccScalarFieldArithmeticsDlg Class Reference

#include <ecvScalarFieldArithmeticsDlg.h>

Inheritance diagram for ccScalarFieldArithmeticsDlg:
Collaboration diagram for ccScalarFieldArithmeticsDlg:

Classes

struct  SF2
 Secondary SF descriptor. More...
 

Public Types

enum  Operation {
  PLUS = 0 , MINUS = 1 , MULTIPLY = 2 , DIVIDE = 3 ,
  SQRT = 4 , POW2 = 5 , POW3 = 6 , EXP = 7 ,
  LOG = 8 , LOG10 = 9 , COS = 10 , SIN = 11 ,
  TAN = 12 , ACOS = 13 , ASIN = 14 , ATAN = 15 ,
  INT = 16 , INVERSE = 17 , INVALID = 255
}
 Arithmetic operations. More...
 

Public Member Functions

 ccScalarFieldArithmeticsDlg (ccPointCloud *cloud, QWidget *parent=0)
 Default constructor. More...
 
Operation getOperation () const
 Returns selected operation. More...
 
bool apply (ccPointCloud *cloud)
 Applies operation on a given cloud. More...
 

Static Public Member Functions

static Operation GetOperationByName (QString name)
 Returns the operation enumerator based on its name. More...
 
static QString GetOperationName (Operation op, QString sf1, QString sf2=QString())
 Returns operation name. More...
 
static bool Apply (ccPointCloud *cloud, Operation op, int sf1Idx, bool inplace, SF2 *sf2=0, QWidget *parent=0)
 Applies operation on a given cloud. More...
 

Protected Slots

void onOperationIndexChanged (int index)
 Called when the operation combo-box is modified. More...
 
void onSF2IndexChanged (int index)
 Called when the SF2 combo-box is modified. More...
 

Protected Member Functions

int getSF1Index ()
 Returns first selected SF index. More...
 
int getSF2Index ()
 Returns second selected SF index. More...
 
QString getOperationName (QString sf1, QString sf2=QString()) const
 Returns selected operation name. More...
 

Detailed Description

Dialog to choose 2 scalar fields (SF) and one operation for arithmetics processing

Definition at line 16 of file ecvScalarFieldArithmeticsDlg.h.

Member Enumeration Documentation

◆ Operation

Arithmetic operations.

Enumerator
PLUS 
MINUS 
MULTIPLY 
DIVIDE 
SQRT 
POW2 
POW3 
EXP 
LOG 
LOG10 
COS 
SIN 
TAN 
ACOS 
ASIN 
ATAN 
INT 
INVERSE 
INVALID 

Definition at line 25 of file ecvScalarFieldArithmeticsDlg.h.

Constructor & Destructor Documentation

◆ ccScalarFieldArithmeticsDlg()

Member Function Documentation

◆ apply()

bool ccScalarFieldArithmeticsDlg::apply ( ccPointCloud cloud)

Applies operation on a given cloud.

Should be applied on the same cloud as the one input to the constructor Otherwise you'd better know what you're doing ;).

Parameters
cloudcloud on which to apply the SF operation
Returns
success

Definition at line 151 of file ecvScalarFieldArithmeticsDlg.cpp.

References Apply(), ccScalarFieldArithmeticsDlg::SF2::constantValue, getOperation(), getSF1Index(), getSF2Index(), ccScalarFieldArithmeticsDlg::SF2::isConstantValue, s_applyInPlace, s_previousConstValue, s_previouslySelectedOperationIndex, and ccScalarFieldArithmeticsDlg::SF2::sfIndex.

Referenced by ccEntityAction::sfArithmetic().

◆ Apply()

bool ccScalarFieldArithmeticsDlg::Apply ( ccPointCloud cloud,
Operation  op,
int  sf1Idx,
bool  inplace,
SF2 sf2 = 0,
QWidget *  parent = 0 
)
static

Applies operation on a given cloud.

Parameters
cloudcloud on which to apply the SF operation
opoperation
sf1Idxfirst (or only) scalar field index
inplacewhether the operation should be applied in place (SF1). Otherwise a new SF will be created.
sf2secondary scalar field / value (only for PLUS, MINUS, MULTIPLY and DIVIDE operations)
parentparent widget (optional)
Returns
success

Definition at line 169 of file ecvScalarFieldArithmeticsDlg.cpp.

References abs(), ACOS, ccPointCloud::addScalarField(), ASIN, ATAN, cloudViewer::ScalarField::computeMinAndMax(), ccScalarFieldArithmeticsDlg::SF2::constantValue, COS, cloudViewer::ScalarField::currentSize(), ccPointCloud::deleteScalarField(), DIVIDE, CVLog::Error(), EXP, cloudViewer::ScalarField::getName(), cloudViewer::PointCloudTpl< T >::getNumberOfScalarFields(), GetOperationName(), cloudViewer::PointCloudTpl< T >::getScalarField(), cloudViewer::PointCloudTpl< T >::getScalarFieldIndexByName(), cloudViewer::ScalarField::getValue(), cloudViewer::GreaterThanEpsilon(), ccPointCloud::hasScalarFields(), INT, INVALID, INVERSE, ccScalarFieldArithmeticsDlg::SF2::isConstantValue, cloudViewer::LessThanEpsilon(), LOG, LOG10, MINUS, MULTIPLY, NAN_VALUE, PLUS, POW2, POW3, cloudViewer::ScalarField::resizeSafe(), ccPointCloud::setCurrentDisplayedScalarField(), cloudViewer::ScalarField::setValue(), ccScalarFieldArithmeticsDlg::SF2::sfIndex, SIN, SQRT, TAN, cloudViewer::ScalarField::ValidValue(), and CVLog::Warning().

Referenced by apply(), CommandSFArithmetic::process(), and CommandSFOperation::process().

◆ getOperation()

ccScalarFieldArithmeticsDlg::Operation ccScalarFieldArithmeticsDlg::getOperation ( ) const

Returns selected operation.

Definition at line 99 of file ecvScalarFieldArithmeticsDlg.cpp.

References INVALID, and s_opCount.

Referenced by apply(), and getOperationName().

◆ GetOperationByName()

ccScalarFieldArithmeticsDlg::Operation ccScalarFieldArithmeticsDlg::GetOperationByName ( QString  name)
static

Returns the operation enumerator based on its name.

Definition at line 116 of file ecvScalarFieldArithmeticsDlg.cpp.

References INVALID, name, s_opCount, and s_opNames.

Referenced by CommandSFArithmetic::process(), and CommandSFOperation::process().

◆ GetOperationName()

QString ccScalarFieldArithmeticsDlg::GetOperationName ( Operation  op,
QString  sf1,
QString  sf2 = QString() 
)
static

Returns operation name.

Definition at line 129 of file ecvScalarFieldArithmeticsDlg.cpp.

References DIVIDE, INVALID, MINUS, MULTIPLY, PLUS, and s_opNames.

Referenced by Apply(), and getOperationName().

◆ getOperationName()

QString ccScalarFieldArithmeticsDlg::getOperationName ( QString  sf1,
QString  sf2 = QString() 
) const
protected

Returns selected operation name.

Definition at line 109 of file ecvScalarFieldArithmeticsDlg.cpp.

References getOperation(), and GetOperationName().

◆ getSF1Index()

int ccScalarFieldArithmeticsDlg::getSF1Index ( )
protected

Returns first selected SF index.

Definition at line 90 of file ecvScalarFieldArithmeticsDlg.cpp.

Referenced by apply().

◆ getSF2Index()

int ccScalarFieldArithmeticsDlg::getSF2Index ( )
protected

Returns second selected SF index.

Definition at line 94 of file ecvScalarFieldArithmeticsDlg.cpp.

Referenced by apply().

◆ onOperationIndexChanged

void ccScalarFieldArithmeticsDlg::onOperationIndexChanged ( int  index)
protectedslot

Called when the operation combo-box is modified.

Definition at line 79 of file ecvScalarFieldArithmeticsDlg.cpp.

References DIVIDE.

Referenced by ccScalarFieldArithmeticsDlg().

◆ onSF2IndexChanged

void ccScalarFieldArithmeticsDlg::onSF2IndexChanged ( int  index)
protectedslot

Called when the SF2 combo-box is modified.

Definition at line 84 of file ecvScalarFieldArithmeticsDlg.cpp.

Referenced by ccScalarFieldArithmeticsDlg().


The documentation for this class was generated from the following files: