SwissKnife.h
Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 //  (c) 2006 by Basler Vision Technologies
00003 //  Section: Vision Components
00004 //  Project: GenApi
00005 //  Author:  Margret Albrecht
00006 //  $Header$
00007 //
00008 //  License: This file is published under the license of the EMVA GenICam  Standard Group.
00009 //  A text file describing the legal terms is included in  your installation as 'GenICam_license.pdf'.
00010 //  If for some reason you are missing  this file please contact the EMVA or visit the website
00011 //  (http://www.genicam.org) for a full copy.
00012 //
00013 //  THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM STANDARD GROUP "AS IS"
00014 //  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
00015 //  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00016 //  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM STANDARD  GROUP
00017 //  OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,  SPECIAL,
00018 //  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT  LIMITED TO,
00019 //  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,  DATA, OR PROFITS;
00020 //  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY  THEORY OF LIABILITY,
00021 //  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT  (INCLUDING NEGLIGENCE OR OTHERWISE)
00022 //  ARISING IN ANY WAY OUT OF THE USE  OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00023 //  POSSIBILITY OF SUCH DAMAGE.
00024 //-----------------------------------------------------------------------------
00031 #ifndef GENAPI_SWISSKNIFE_H
00032 #define GENAPI_SWISSKNIFE_H
00033 
00034 #include "../IFloat.h"
00035 #include "Node.h"
00036 #include "MathParser/MathParser.h"
00037 #include "BaseT.h"
00038 #include "ValueT.h"
00039 #include "NodeT.h"
00040 #include "FloatT.h"
00041 
00042 namespace GENAPI_NAMESPACE
00043 {
00044     //*************************************************************
00045     // CSwissKnife class
00046     //*************************************************************
00047 
00056     class CSwissKnifeImpl : public IFloat,  public CNodeImpl
00057     {
00058     public:
00060         CSwissKnifeImpl();
00061 
00063         virtual ~CSwissKnifeImpl();
00064 
00065     protected:
00066         //-------------------------------------------------------------
00067         // IBase implementation
00068         //-------------------------------------------------------------
00069 
00070         // Get access mode
00071         virtual EAccessMode InternalGetAccessMode() const;
00072 
00074         virtual EInterfaceType InternalGetPrincipalInterfaceType() const
00075         {
00076             return intfIFloat;
00077         }
00078 
00079 
00080     public:
00081         //-------------------------------------------------------------
00082         // IInteger implementation
00083         //-------------------------------------------------------------
00084 
00086 
00087         virtual double GetValueWithInput(double input, bool Verify = false, bool IgnoreCache = false);
00088 
00089     protected:
00090         //-------------------------------------------------------------
00091         // IFloat implementation
00092         //-------------------------------------------------------------
00093 
00094         // Set feature value
00095         #pragma BullseyeCoverage off
00096         virtual void InternalSetValue(double /*Value*/, bool /*Verify*/ )
00097         {
00098             throw LOGICAL_ERROR_EXCEPTION_NODE("SwissKnife : %s SetValue failed. SwissKnife is read only", m_Name.c_str() );
00099         }
00100         #pragma BullseyeCoverage on
00101 
00102         // Get feature value
00103         virtual double InternalGetValue(bool Verify = false, bool IgnoreCache = false);
00104 
00105         // Get minimum value allowed
00106         virtual double InternalGetMin()
00107         {
00108             return m_Min;
00109         }
00110 
00111         // Get maximum value allowed
00112         virtual double InternalGetMax()
00113         {
00114             return m_Max;
00115         }
00116 
00118         virtual bool InternalHasInc()
00119         {
00120             // a swiss knife does not know about its increments
00121             return false;
00122         }
00123 
00125         #pragma BullseyeCoverage off
00126         // (untestable, function never called)
00127         virtual double InternalGetInc()
00128         {
00129             assert(false);
00130             return -1.0;
00131         }
00132         #pragma BullseyeCoverage on
00133 
00135         const virtual double_autovector_t InternalGetListOfValidValues()
00136         {
00137             return double_autovector_t();
00138         }
00139 
00140 
00141         // Get recommended representation
00142         virtual  ERepresentation InternalGetRepresentation()
00143         {
00144             if( m_Representation != _UndefinedRepresentation )
00145                 return m_Representation;
00146             else
00147                 return PureNumber;
00148         }
00149 
00150         // Get unit
00151         virtual GENICAM_NAMESPACE::gcstring InternalGetUnit() const
00152         {
00153             return m_Unit;
00154         }
00155 
00157         virtual EDisplayNotation InternalGetDisplayNotation() const
00158         {
00159             return m_DisplayNotation;
00160         }
00161 
00163         virtual int64_t InternalGetDisplayPrecision() const
00164         {
00165             return m_DisplayPrecision;
00166         }
00167 
00169         virtual ECachingMode InternalGetCachingMode() const;
00170 
00171     public:
00172         //-------------------------------------------------------------
00173         // Initializing
00174         //-------------------------------------------------------------
00175 
00176         virtual void FinalConstruct();
00177 
00178         virtual void SetProperty( CProperty &Property );
00179         
00180         virtual bool GetProperty(CNodeDataMap *pNodeDataMap, CPropertyID::EProperty_ID_t PropertyID, CNodeData::PropertyVector_t &PropertyList) const;
00181 
00182     protected:
00183 
00184         //-------------------------------------------------------------
00185         // Member variables
00186         //-------------------------------------------------------------
00187 
00189         double  m_Min;
00190 
00192         double  m_Max;
00193 
00195         GENICAM_NAMESPACE::gcstring m_Formula;
00196 
00198         std::map<GENICAM_NAMESPACE::gcstring, GENICAM_NAMESPACE::gcstring> m_Symbolics;
00199 
00201         std::map<GENICAM_NAMESPACE::gcstring, CFloatPolyRef> m_Variables;
00202 
00204         CMathParser m_MathParser;
00205 
00207         ERepresentation m_Representation;
00208 
00210         GENICAM_NAMESPACE::gcstring m_Unit;
00211 
00213         EDisplayNotation m_DisplayNotation;
00214 
00216         int64_t m_DisplayPrecision;
00217 
00219 
00220         GENICAM_NAMESPACE::gcstring m_InputName;
00221 
00223         GENAPI_NAMESPACE::EInputDirection m_InputDirection;
00224 
00226         CFloatPolyRef m_Input;
00227 
00228     };
00229 
00230     class CSwissKnife : public BaseT< ValueT< NodeT< FloatT<  CSwissKnifeImpl > > > >
00231     {
00232     };
00233 
00234 }
00235 
00236 #endif // GENAPI_SWISSKNIFE_H


rc_visard_driver
Author(s): Heiko Hirschmueller , Christian Emmerich , Felix Ruess
autogenerated on Thu Jun 6 2019 20:43:06