1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00
occt/samples/mfc/standard/Common/DimensionDlg.h
mpa 016e595986 0026886: Visualization, TKV3d - eliminate global variables
- AIS_InteractiveContext - create new dummy class field to have an empty TopoDS_Shape object.
- AIS_Point, PrsMgr_PresentableObject - rename static variables to local function variables.
- AIS_Shape, SelectMgr_SelectableObject - remove unused static variables.
- Graphic3d_MaterialAspect, V3d_Viewer - make global static variables as constant.
- V3d_View - move global variable zRotation to class field.
- Move a variable theCurrentSelection as a field of AIS_InteractiveContext and AIS_LocalContext classes. Multiple selection is not used now, so each Context have an own selection.
- Move myStructGenId from Graphic3d_StructureManager to Graphic3d_GraphicDriver for identifying the structures in the driver.
- Move default variable (no shading light) from static value to the class field of OpenGL_View.
Porting note:
- Static methods of AIS_Selection is not used now. Methods of
  AIS_InteractiveContext::InitSelected(),::MoreSelected(),::NextSelected()
  should be used instead of static methods of AIS_Selection.
2016-04-22 15:21:39 +03:00

82 lines
2.4 KiB
C++
Executable File

#pragma once
// DimensionDlg dialog
#include <stdafx.h>
#include "res\OCC_Resource.h"
#include <Standard_Macro.hxx>
#include <AIS_InteractiveContext.hxx>
#include <TCollection_AsciiString.hxx>
#include <Quantity_Color.hxx>
class CDimensionDlg : public CDialog
{
public:
/// Construction & termination
CDimensionDlg (CWnd* pParent = NULL); // standard constructor
CDimensionDlg (Handle(AIS_InteractiveContext) &theAISContext,
CWnd* pParent = NULL);
virtual ~CDimensionDlg();
// Methods for data operation
void SetContext (const Handle(AIS_InteractiveContext) theContext);
void SetTextModeControlsVisible (bool isVisible);
void UpdateUnitsListForLength();
void UpdateUnitsListForAngle();
void Empty();
void DeactivateAllStandardModes();
void UpdateStandardModeForAngle ();
void UpdateStandardModeForLength ();
void UpdateStandardMode ();
const Standard_Real GetFlyout () const;
const Standard_Boolean GetTextType() const;
const Standard_Real GetFontHeight() const;
const Standard_Boolean IsText3dShaded() const;
const Standard_Boolean IsUnitsDisplayed() const;
const TCollection_AsciiString GetUnits() const;
const Quantity_Color GetDimensionColor() const;
public:
// Dialog Data
enum { IDD = IDD_Dimension };
// Initialization of dialog
protected:
virtual BOOL OnInitDialog();
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
DECLARE_MESSAGE_MAP()
//Attributes
private:
Handle (AIS_InteractiveContext) myAISContext;
int mySelectedDimType;
int myFontSize;
Quantity_Color myDimensionColor;
CTabCtrl *myLengthParams;
CTabCtrl *myAngleParams;
CTabCtrl *myRadiusParams;
CTabCtrl *myDiameterParams;
void CreateLengthParamsTab();
void CreateAngleParamsTab();
void CreateRadiusParamsTab();
void CreateDiameterParamsTab();
public:
afx_msg void OnBnClickedOk();
afx_msg void OnBnClickedDimLength();
afx_msg void OnBnClickedDimAngle();
afx_msg void OnBnClickedDimRadius();
afx_msg void OnTcnSelChangeLengthTab(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnTcnSelChangingLengthTab(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnDestroy();
afx_msg void OnTcnSelChangeAngleTab(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnTcnSelChangingAngleTab(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnBnClickedDimDiameter();
afx_msg void OnBnClicked2dText();
afx_msg void OnBnClicked3dText();
afx_msg void OnBnClickedDimensionColor();
afx_msg void OnClose();
};