TAPs 0.7.7.3
TAPsWXHETriMeshOneModelMultiPartsParameters.hpp
Go to the documentation of this file.
00001 /******************************************************************************
00002 TAPsWXHETriMeshOneModelMultiPartsParameters.hpp
00003 ******************************************************************************/
00007 /******************************************************************************
00008 SUKITTI PUNAK   (10/02/2009)
00009 UPDATE          (10/02/2009)
00010 ******************************************************************************/
00011 #ifndef TAPs_WX_HE_TRI_MESH_ONE_MODEL_MULTI_PARTS_PARAMETERS_HPP
00012 #define TAPs_WX_HE_TRI_MESH_ONE_MODEL_MULTI_PARTS_PARAMETERS_HPP
00013 
00014 #include "wx/wx.h"
00015 #include "wx/image.h"
00016 #include "wx/xrc/xmlres.h"
00017 #include "wx/msgdlg.h"
00018 #include "wx/notebook.h"
00019 
00020 // the application icon
00021 #if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__)
00022     #include "rc/appicon.xpm"
00023 #endif
00024 
00025 #include "../../IO/TAPsTextFile.hpp"
00026 
00027 BEGIN_NAMESPACE_TAPs__WX
00028 //=============================================================================
00029 class WXHETriMeshOneModelMultiPartsParameters : public wxDialog {
00030 //=============================================================================
00031 public:
00032     // Member Functions -------------------------------------------------------
00033     //-------------------------------------------------------------------------
00034     
00036     WXHETriMeshOneModelMultiPartsParameters (
00037         void *  pParts      
00038     );
00039 
00041     ~WXHETriMeshOneModelMultiPartsParameters ();
00042 
00044     bool IsInitialized () const { return g_isInitialized; }
00045 
00047     //bool IsLoaded () const    { return m_isLoaded; }
00048 
00050     template <typename T>
00051     void PropertyDialog (
00052         wxWindow * parent,  
00053         TransformationSupport<T> * pTrxSupport, 
00054         std::vector< SimPropForMultiPartMeshModel_HalfEdge<T> > * pListOfParts  
00055     );
00056 
00057     // Data Members -----------------------------------------------------------
00058 //=============================================================================
00059 protected:
00060     // Member Functions -------------------------------------------------------
00061 
00063     void OnEnteringParameters ( wxCommandEvent & event );
00064 
00066     void OnChangingParameters ( wxCommandEvent & event );
00067 
00069     template <typename T> void WriteParameters ( wxCommandEvent & event );
00070 
00072     void OnLoadParameters ( wxCommandEvent & event );
00073 
00075     void OnSaveParameters ( wxCommandEvent & event );
00076 
00078     template <typename T> void ShowParametersValuesInGUI ();
00079 
00081     void InitControlLooks ();
00082 
00084 //  template <typename T> void ApplyParameters ( HETriMeshOneModelMultiPartsParameters<T> & parSet );
00085 
00087 //  template <typename T> void SetParametersFromGUI ( HETriMeshOneModelMultiPartsParameters<T> & par );
00088 
00089     // Data Members -----------------------------------------------------------
00090 
00091     // Parameters
00092     type_info const *   m_pDataTypeInfo;    
00093     //std::vector< SimPropForMultiPartMeshModel_HalfEdge<T> > m_Parts;  //!< list of parts
00094     void *  m_pTrxSupport;  
00095     void *  m_pParts;       
00096 
00097     // For initialization
00098     bool            m_isLoaded;         
00099     static bool     g_isInitialized;    
00100 
00101     // wxWidgets styles
00102     static wxColour color_textEdit;     
00103     static wxColour color_textNormal;   
00104     static wxColour color_textWarning;  
00105 //=============================================================================
00106 private:
00107     // Member Functions -------------------------------------------------------
00108     
00111     void SetIDs ();
00114     void SetIDs_PartProps ( wxPanel * pPanel );
00115 
00116     // Data Members -----------------------------------------------------------
00117 
00118     bool m_bAllIDsWorking;  
00119 
00121     enum {
00122         BEGIN_NUMBER = 1500,
00123 
00124         ID_WXHeTmOmMp_Type,
00125         ID_WXHeTmOmMp_Name_TextCtrl,
00126         ID_WXHeTmOmMp_Name_Button,
00127         ID_WXHeTmOmMp_TrxTranslationX,
00128         ID_WXHeTmOmMp_TrxTranslationY,
00129         ID_WXHeTmOmMp_TrxTranslationZ,
00130         ID_WXHeTmOmMp_TrxRotationAxisX,
00131         ID_WXHeTmOmMp_TrxRotationAxisY,
00132         ID_WXHeTmOmMp_TrxRotationAxisZ,
00133         ID_WXHeTmOmMp_TrxRotationAngle,
00134         ID_WXHeTmOmMp_TrxScaleX,
00135         ID_WXHeTmOmMp_TrxScaleY,
00136         ID_WXHeTmOmMp_TrxScaleZ,
00137         ID_WXHeTmOmMp_MassTotal,
00138         ID_WXHeTmOmMp_MassPt,
00139         ID_WXHeTmOmMp_SpringStiffness,
00140         ID_WXHeTmOmMp_SpringDamper,
00141         ID_WXHeTmOmMp_HomeSpringStiffness,
00142         ID_WXHeTmOmMp_HomeSpringDamper,
00143         ID_WXHeTmOmMp_SimTimeStep,
00144         ID_WXHeTmOmMp_NumOfSimIterations,
00145 
00146         ID_WXHeTmOmMp_TrxEnable,
00147         ID_WXHeTmOmMp_SimEnableSimulation,
00148         ID_WXHeTmOmMp_SimEnableCollision,
00149         ID_WXHeTmOmMp_SimEnableRendering,
00150 
00151         ID_WXHeTmOmMp_PartProp_Notebook,
00152 
00153         DUMMY
00154     };
00155 
00156     // Pointers to the controls
00157     //---------------------------------------------------------------
00158     wxTextCtrl *    m_pID_WXHeTmOmMp_Type;
00159     wxTextCtrl *    m_pID_WXHeTmOmMp_Name_TextCtrl;
00160     wxTextCtrl *    m_pID_WXHeTmOmMp_Name_Button;
00161     //wxTextCtrl *  m_pID_WXHeTmOmMp_MassTotal;
00162     wxTextCtrl *    m_pID_WXHeTmOmMp_TrxTranslationX;
00163     wxTextCtrl *    m_pID_WXHeTmOmMp_TrxTranslationY;
00164     wxTextCtrl *    m_pID_WXHeTmOmMp_TrxTranslationZ;
00165     wxTextCtrl *    m_pID_WXHeTmOmMp_TrxRotationAxisX;
00166     wxTextCtrl *    m_pID_WXHeTmOmMp_TrxRotationAxisY;
00167     wxTextCtrl *    m_pID_WXHeTmOmMp_TrxRotationAxisZ;
00168     wxTextCtrl *    m_pID_WXHeTmOmMp_TrxRotationAngle;
00169     wxTextCtrl *    m_pID_WXHeTmOmMp_TrxScaleX;
00170     wxTextCtrl *    m_pID_WXHeTmOmMp_TrxScaleY;
00171     wxTextCtrl *    m_pID_WXHeTmOmMp_TrxScaleZ;
00172     wxCheckBox *    m_pID_WXHeTmOmMp_TrxEnable;
00173     wxNotebook *    m_pID_WXHeTmOmMp_PartProp_Notebook;
00174 
00175     class PartProp {
00176     public:
00177         wxTextCtrl *    m_pID_WXHeTmOmMp_MassTotal;
00178         wxTextCtrl *    m_pID_WXHeTmOmMp_MassPt;
00179         wxTextCtrl *    m_pID_WXHeTmOmMp_SpringStiffness;
00180         wxTextCtrl *    m_pID_WXHeTmOmMp_SpringDamper;
00181         wxTextCtrl *    m_pID_WXHeTmOmMp_HomeSpringStiffness;
00182         wxTextCtrl *    m_pID_WXHeTmOmMp_HomeSpringDamper;
00183         wxTextCtrl *    m_pID_WXHeTmOmMp_SimTimeStep;
00184         wxTextCtrl *    m_pID_WXHeTmOmMp_NumOfSimIterations;
00185         wxCheckBox *    m_pID_WXHeTmOmMp_SimEnableSimulation;
00186         wxCheckBox *    m_pID_WXHeTmOmMp_SimEnableCollision;
00187         wxCheckBox *    m_pID_WXHeTmOmMp_SimEnableRendering;
00188     };
00189     std::vector< PartProp > m_PartProps;    
00190     //---------------------------------------------------------------
00191 
00192     DECLARE_CLASS ( WXHETriMeshOneModelMultiPartsParameters )
00193     DECLARE_EVENT_TABLE ()
00194 
00195 //=============================================================================
00196 }; // END CLASS WXHETriMeshOneModelMultiPartsParameters
00197 //=============================================================================
00198 END_NAMESPACE_TAPs__WX
00199 //-----------------------------------------------------------------------------
00200 #include "TAPsWXHETriMeshOneModelMultiPartsParameters.cpp"
00201 //-----------------------------------------------------------------------------
00202 #endif
00203 //34567890123456789012345678901234567890123456789012345678901234567890123456789
00204 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines