1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-05 18:16:23 +03:00
occt/samples/mfc/standard/Common/DimensionDlg.h
aba 4716247158 0025284: Problems with standard MFC samples
- OCAF sample Save Document option: corrected conversion from LPCTSTR to Standard_CString
 - HLR sample: corrected mouse move event handling for HLR 2D view; Corrected CSelectionDialog view displaying and updating
 - Geometry sample: CGeometryDoc correction to avoid code duplication
 - OCC_3dBaseDoc: corrected DragEvent() handler for proper emulation of rectangle selection.
 - Viewer3d sample: moved resource files (resource.h; resource.hm; AISToolbar.bmp) from /src to /res

Code style changes

Fixed "About" dialog error in release.

Corrected dimension dialogs

Workaround for dimensions sample: AIS_LocalContext::SelectedShape() doesn't take into account TopoDS shape local transformation, and operates with selected interactive transformation.
2014-10-09 16:02:12 +04:00

88 lines
2.7 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:
// Workaround: AIS_LocalContext::SelectedShape() doesn't take into account local location of selected TopoDS shape,
// and operates with selected interactive object transformation only.
static TopoDS_Shape SelectedShape();
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();
};