VR-Link API Documentation for HLA 1516
artPartThresh.h
Go to the documentation of this file.
00001 /*********************************************************************
00002 ** Copyright (c) 1992-2010 VT MAK
00003 ** All rights reserved.
00004 *********************************************************************/
00005 
00010 #ifndef artPartThresh_h_
00011 #define artPartThresh_h_
00012 
00013 #include "articulatedPartCollection.h"
00014 
00015 #include <matrix/LibMatrix.h>
00016 #include <vlutil/vlUtil.h>
00017 
00021 class DT_DLL_VLPROTIND DtArtPartThresholder
00022 {
00023 
00024 public:
00025 
00026    enum DtArtPartThresholdType
00027    {
00028       DtArtPartDfltThreshMode = -1,
00029       DtArtPartIndividualThresh = 0,
00030       DtArtPartAggregateThresh = 1
00031    };
00032 
00033 public:
00034 
00036    DtArtPartThresholder();
00037 
00039    virtual ~DtArtPartThresholder();
00040 
00042    DtArtPartThresholder(const DtArtPartThresholder& orig);
00043 
00045    DtArtPartThresholder& operator=(const DtArtPartThresholder& orig);
00046 
00049    virtual void setRotationThreshold(double thresh);
00050    virtual double rotationThreshold() const;
00051 
00053    virtual double rotationTraceThreshold() const;
00054 
00057    virtual void setTranslationThreshold(double thresh);
00058    virtual double translationThreshold() const;
00059 
00062    virtual void setFractionalThreshold(double thresh);
00063    virtual double fractionalThreshold() const;
00064 
00067    virtual void setThreshMode(DtArtPartThresholdType mode);
00068    virtual DtArtPartThresholdType threshMode() const;
00069 
00072    virtual bool artPartsExceedAggThreshold(
00073       const DtArticulatedPartCollection& localList,
00074       const DtArticulatedPartCollection& remoteList) const;
00075 
00078    virtual bool artPartsExceedIndivThreshold(
00079       const DtArticulatedPartCollection& localList,
00080       const DtArticulatedPartCollection& remoteList) const;
00081 
00084    virtual float artPartThreshold(int paramType) const;
00085 
00086 public:
00087 
00089    static void setDfltThreshMode(DtArtPartThresholdType mode);
00090    static DtArtPartThresholdType dfltThreshMode();
00091 
00093    static void setDfltFractionalThreshold(DtFloat32 thresh);
00094    static DtFloat32 dfltFractionalThreshold();
00095 
00097    static void setDfltRotationThreshold(double r);
00098    static double dfltRotationThreshold();
00099 
00101    static void setDfltTranslationThreshold(double t);
00102    static double dfltTranslationThreshold();
00103 
00104 protected:
00105 
00106    DtArtPartThresholdType myThreshMode;
00107    float myFracThresh;
00108    double myTransThresh;
00109    double myRotThresh;
00110    double myTraceRotThresh;
00111 
00112    bool myUsingDfltMode;
00113    bool myUsingDfltTrans;
00114    bool myUsingDfltRot;
00115    bool myUsingDfltFrac;
00116 
00117 protected:
00118 
00119    static DtArtPartThresholdType theDfltThreshMode;
00120    static float theDfltFracThresh;
00121    static double theDfltTransThresh;
00122    static double theDfltRotThresh;
00123    static double theDfltTraceRotThresh;
00124 };
00125 
00126 inline void DtArtPartThresholder::setDfltFractionalThreshold(
00127    DtFloat32 thresh)
00128 {
00129    theDfltFracThresh = thresh;
00130 }
00131 
00132 inline DtFloat32 DtArtPartThresholder::dfltFractionalThreshold()
00133 {
00134    return theDfltFracThresh;
00135 }
00136 
00137 inline void DtArtPartThresholder::setDfltThreshMode(
00138    DtArtPartThresholdType mode)
00139 {
00140    theDfltThreshMode = mode;
00141 }
00142 
00143 inline DtArtPartThresholder::DtArtPartThresholdType 
00144    DtArtPartThresholder::dfltThreshMode()
00145 {
00146    return theDfltThreshMode;
00147 }
00148 
00149 inline double DtArtPartThresholder::dfltRotationThreshold()
00150 {
00151    return theDfltRotThresh;
00152 }
00153 
00154 inline void DtArtPartThresholder::setDfltRotationThreshold(double thresh)
00155 {
00156    theDfltRotThresh = DtLimit(thresh, -M_PI, M_PI);
00157    theDfltTraceRotThresh = 2.0 * cos(dfltRotationThreshold()) + 1.0;
00158 }
00159 
00160 inline double DtArtPartThresholder::dfltTranslationThreshold()
00161 {
00162    return theDfltTransThresh;
00163 }
00164 
00165 inline void DtArtPartThresholder::setDfltTranslationThreshold(double t)
00166 {
00167    theDfltTransThresh = t;
00168 }
00169 
00170 #endif
00171 

Document ID: Generated on Mon May 14 08:06:18 EDT 2012 from SVN revision 114750
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)