mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
Adding svn:eol-style=LF property
This commit is contained in:
parent
b96f3bea25
commit
c6c9371fe3
@ -1,244 +1,244 @@
|
|||||||
// GeometryDoc.h : interface of the CGeometryDoc class
|
// GeometryDoc.h : interface of the CGeometryDoc class
|
||||||
//
|
//
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#if !defined(AFX_VIEWERDOC_H__4EF39FBA_4EBB_11D1_8D67_0800369C8A03__INCLUDED_)
|
#if !defined(AFX_VIEWERDOC_H__4EF39FBA_4EBB_11D1_8D67_0800369C8A03__INCLUDED_)
|
||||||
#define AFX_VIEWERDOC_H__4EF39FBA_4EBB_11D1_8D67_0800369C8A03__INCLUDED_
|
#define AFX_VIEWERDOC_H__4EF39FBA_4EBB_11D1_8D67_0800369C8A03__INCLUDED_
|
||||||
|
|
||||||
#if _MSC_VER >= 1000
|
#if _MSC_VER >= 1000
|
||||||
#pragma once
|
#pragma once
|
||||||
#endif // _MSC_VER >= 1000
|
#endif // _MSC_VER >= 1000
|
||||||
|
|
||||||
#include "ISession2D_InteractiveContext.h"
|
#include "ISession2D_InteractiveContext.h"
|
||||||
#include "ResultDialog.h"
|
#include "ResultDialog.h"
|
||||||
|
|
||||||
class Handle_AIS_Point;
|
class Handle_AIS_Point;
|
||||||
|
|
||||||
class CGeometryDoc : public CDocument
|
class CGeometryDoc : public CDocument
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void Put2DOnTop(bool isMax = true);
|
void Put2DOnTop(bool isMax = true);
|
||||||
void Put3DOnTop(bool isMax = true);
|
void Put3DOnTop(bool isMax = true);
|
||||||
void Fit2DViews();
|
void Fit2DViews();
|
||||||
void Set3DViewsZoom(const Quantity_Factor& Coef );
|
void Set3DViewsZoom(const Quantity_Factor& Coef );
|
||||||
void Fit3DViews(Quantity_Coefficient Coef);
|
void Fit3DViews(Quantity_Coefficient Coef);
|
||||||
void simplify(const TopoDS_Shape& aShape);
|
void simplify(const TopoDS_Shape& aShape);
|
||||||
|
|
||||||
|
|
||||||
static void Fit();
|
static void Fit();
|
||||||
|
|
||||||
// 2D
|
// 2D
|
||||||
|
|
||||||
void DragEvent2D (const Standard_Integer x ,
|
void DragEvent2D (const Standard_Integer x ,
|
||||||
const Standard_Integer y ,
|
const Standard_Integer y ,
|
||||||
const Standard_Integer TheState,
|
const Standard_Integer TheState,
|
||||||
const Handle_V2d_View& aView );
|
const Handle_V2d_View& aView );
|
||||||
void InputEvent2D (const Standard_Integer x ,
|
void InputEvent2D (const Standard_Integer x ,
|
||||||
const Standard_Integer y ,
|
const Standard_Integer y ,
|
||||||
const Handle_V2d_View& aView );
|
const Handle_V2d_View& aView );
|
||||||
void MoveEvent2D (const Standard_Integer x ,
|
void MoveEvent2D (const Standard_Integer x ,
|
||||||
const Standard_Integer y ,
|
const Standard_Integer y ,
|
||||||
const Handle_V2d_View& aView );
|
const Handle_V2d_View& aView );
|
||||||
void ShiftMoveEvent2D (const Standard_Integer x ,
|
void ShiftMoveEvent2D (const Standard_Integer x ,
|
||||||
const Standard_Integer y ,
|
const Standard_Integer y ,
|
||||||
const Handle_V2d_View& aView );
|
const Handle_V2d_View& aView );
|
||||||
void ShiftDragEvent2D (const Standard_Integer x ,
|
void ShiftDragEvent2D (const Standard_Integer x ,
|
||||||
const Standard_Integer y ,
|
const Standard_Integer y ,
|
||||||
const Standard_Integer TheState,
|
const Standard_Integer TheState,
|
||||||
const Handle_V2d_View& aView );
|
const Handle_V2d_View& aView );
|
||||||
void ShiftInputEvent2D (const Standard_Integer x ,
|
void ShiftInputEvent2D (const Standard_Integer x ,
|
||||||
const Standard_Integer y ,
|
const Standard_Integer y ,
|
||||||
const Handle_V2d_View& aView );
|
const Handle_V2d_View& aView );
|
||||||
void Popup2D (const Standard_Integer x ,
|
void Popup2D (const Standard_Integer x ,
|
||||||
const Standard_Integer y ,
|
const Standard_Integer y ,
|
||||||
const Handle_V2d_View& aView );
|
const Handle_V2d_View& aView );
|
||||||
|
|
||||||
Handle_AIS_InteractiveObject drawSurface
|
Handle_AIS_InteractiveObject drawSurface
|
||||||
(const Handle_Geom_Surface& theSurface,
|
(const Handle_Geom_Surface& theSurface,
|
||||||
const Quantity_Color& theColor,
|
const Quantity_Color& theColor,
|
||||||
const Standard_Boolean toDisplay);
|
const Standard_Boolean toDisplay);
|
||||||
|
|
||||||
Standard_Boolean WaitForInput (unsigned long aMilliSeconds);
|
Standard_Boolean WaitForInput (unsigned long aMilliSeconds);
|
||||||
// Waits for a user input or a period of time has been elapsed
|
// Waits for a user input or a period of time has been elapsed
|
||||||
|
|
||||||
Handle_AIS_Point drawPoint (const gp_Pnt& thePnt,
|
Handle_AIS_Point drawPoint (const gp_Pnt& thePnt,
|
||||||
const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_GREEN),
|
const Quantity_Color& theColor = Quantity_Color(Quantity_NOC_GREEN),
|
||||||
const Standard_Boolean toDisplay = Standard_True);
|
const Standard_Boolean toDisplay = Standard_True);
|
||||||
// creates a presentation of the given point
|
// creates a presentation of the given point
|
||||||
// and displays it in the viewer if toDisplay = Standard_True
|
// and displays it in the viewer if toDisplay = Standard_True
|
||||||
|
|
||||||
Handle_AIS_Shape drawShape (const TopoDS_Shape& theShape,
|
Handle_AIS_Shape drawShape (const TopoDS_Shape& theShape,
|
||||||
const Graphic3d_NameOfMaterial theMaterial = Graphic3d_NOM_BRASS,
|
const Graphic3d_NameOfMaterial theMaterial = Graphic3d_NOM_BRASS,
|
||||||
const Standard_Boolean toDisplay = Standard_True);
|
const Standard_Boolean toDisplay = Standard_True);
|
||||||
// creates a presentation of the given shape with the given material
|
// creates a presentation of the given shape with the given material
|
||||||
// (color is default for a given material)
|
// (color is default for a given material)
|
||||||
// and displays it in the viewer if toDisplay = Standard_True
|
// and displays it in the viewer if toDisplay = Standard_True
|
||||||
|
|
||||||
protected: // create from serialization only
|
protected: // create from serialization only
|
||||||
CGeometryDoc();
|
CGeometryDoc();
|
||||||
DECLARE_DYNCREATE(CGeometryDoc)
|
DECLARE_DYNCREATE(CGeometryDoc)
|
||||||
|
|
||||||
// Attributes
|
// Attributes
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Operations
|
// Operations
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Overrides
|
// Overrides
|
||||||
// ClassWizard generated virtual function overrides
|
// ClassWizard generated virtual function overrides
|
||||||
//{{AFX_VIRTUAL(CGeometryDoc)
|
//{{AFX_VIRTUAL(CGeometryDoc)
|
||||||
public:
|
public:
|
||||||
virtual BOOL OnNewDocument();
|
virtual BOOL OnNewDocument();
|
||||||
virtual void Serialize(CArchive& ar);
|
virtual void Serialize(CArchive& ar);
|
||||||
virtual void OnCloseDocument();
|
virtual void OnCloseDocument();
|
||||||
//}}AFX_VIRTUAL
|
//}}AFX_VIRTUAL
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
public:
|
public:
|
||||||
virtual ~CGeometryDoc();
|
virtual ~CGeometryDoc();
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
virtual void AssertValid() const;
|
virtual void AssertValid() const;
|
||||||
virtual void Dump(CDumpContext& dc) const;
|
virtual void Dump(CDumpContext& dc) const;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Generated message map functions
|
// Generated message map functions
|
||||||
protected:
|
protected:
|
||||||
//{{AFX_MSG(CGeometryDoc)
|
//{{AFX_MSG(CGeometryDoc)
|
||||||
afx_msg void OnWindowNew2d();
|
afx_msg void OnWindowNew2d();
|
||||||
afx_msg void OnBUTTONTest1();
|
afx_msg void OnBUTTONTest1();
|
||||||
afx_msg void OnBUTTONTest2();
|
afx_msg void OnBUTTONTest2();
|
||||||
afx_msg void OnBUTTONTest3();
|
afx_msg void OnBUTTONTest3();
|
||||||
afx_msg void OnBUTTONTest4();
|
afx_msg void OnBUTTONTest4();
|
||||||
afx_msg void OnBUTTONTest5();
|
afx_msg void OnBUTTONTest5();
|
||||||
afx_msg void OnBUTTONTest6();
|
afx_msg void OnBUTTONTest6();
|
||||||
afx_msg void OnBUTTONTest7();
|
afx_msg void OnBUTTONTest7();
|
||||||
afx_msg void OnBUTTONTest8();
|
afx_msg void OnBUTTONTest8();
|
||||||
afx_msg void OnBUTTONTest9();
|
afx_msg void OnBUTTONTest9();
|
||||||
afx_msg void OnBUTTONTest10();
|
afx_msg void OnBUTTONTest10();
|
||||||
afx_msg void OnBUTTONTest11();
|
afx_msg void OnBUTTONTest11();
|
||||||
afx_msg void OnBUTTONTest12();
|
afx_msg void OnBUTTONTest12();
|
||||||
afx_msg void OnBUTTONTest13();
|
afx_msg void OnBUTTONTest13();
|
||||||
afx_msg void OnBUTTONTest14();
|
afx_msg void OnBUTTONTest14();
|
||||||
afx_msg void OnBUTTONTest15();
|
afx_msg void OnBUTTONTest15();
|
||||||
afx_msg void OnBUTTONTest16();
|
afx_msg void OnBUTTONTest16();
|
||||||
afx_msg void OnBUTTONTest17();
|
afx_msg void OnBUTTONTest17();
|
||||||
afx_msg void OnBUTTONTest18();
|
afx_msg void OnBUTTONTest18();
|
||||||
afx_msg void OnBUTTONTest19();
|
afx_msg void OnBUTTONTest19();
|
||||||
afx_msg void OnBUTTONTest20();
|
afx_msg void OnBUTTONTest20();
|
||||||
afx_msg void OnBUTTONTest21();
|
afx_msg void OnBUTTONTest21();
|
||||||
afx_msg void OnBUTTONTest22();
|
afx_msg void OnBUTTONTest22();
|
||||||
afx_msg void OnBUTTONTest23();
|
afx_msg void OnBUTTONTest23();
|
||||||
afx_msg void OnBUTTONTest24();
|
afx_msg void OnBUTTONTest24();
|
||||||
afx_msg void OnBUTTONTest25();
|
afx_msg void OnBUTTONTest25();
|
||||||
afx_msg void OnBUTTONTest26();
|
afx_msg void OnBUTTONTest26();
|
||||||
afx_msg void OnBUTTONTest27();
|
afx_msg void OnBUTTONTest27();
|
||||||
afx_msg void OnBUTTONTest28();
|
afx_msg void OnBUTTONTest28();
|
||||||
afx_msg void OnBUTTONTest29();
|
afx_msg void OnBUTTONTest29();
|
||||||
afx_msg void OnBUTTONTest30();
|
afx_msg void OnBUTTONTest30();
|
||||||
afx_msg void OnBUTTONTest31();
|
afx_msg void OnBUTTONTest31();
|
||||||
afx_msg void OnBUTTONTest32();
|
afx_msg void OnBUTTONTest32();
|
||||||
afx_msg void OnBUTTONTest33();
|
afx_msg void OnBUTTONTest33();
|
||||||
afx_msg void OnBUTTONTest34();
|
afx_msg void OnBUTTONTest34();
|
||||||
afx_msg void OnBUTTONTest35();
|
afx_msg void OnBUTTONTest35();
|
||||||
afx_msg void OnBUTTONTest36();
|
afx_msg void OnBUTTONTest36();
|
||||||
afx_msg void OnBUTTONTest37();
|
afx_msg void OnBUTTONTest37();
|
||||||
afx_msg void OnBUTTONTest38();
|
afx_msg void OnBUTTONTest38();
|
||||||
afx_msg void OnBUTTONTest39();
|
afx_msg void OnBUTTONTest39();
|
||||||
afx_msg void OnBUTTONTest40();
|
afx_msg void OnBUTTONTest40();
|
||||||
afx_msg void OnBUTTONTest41();
|
afx_msg void OnBUTTONTest41();
|
||||||
afx_msg void OnBUTTONTest42();
|
afx_msg void OnBUTTONTest42();
|
||||||
afx_msg void OnBUTTONTest43();
|
afx_msg void OnBUTTONTest43();
|
||||||
afx_msg void OnBUTTONTest44();
|
afx_msg void OnBUTTONTest44();
|
||||||
afx_msg void OnBUTTONTest45();
|
afx_msg void OnBUTTONTest45();
|
||||||
afx_msg void OnBUTTONTest46();
|
afx_msg void OnBUTTONTest46();
|
||||||
afx_msg void OnBUTTONTest47();
|
afx_msg void OnBUTTONTest47();
|
||||||
afx_msg void OnBUTTONTest48();
|
afx_msg void OnBUTTONTest48();
|
||||||
afx_msg void OnBUTTONTest49();
|
afx_msg void OnBUTTONTest49();
|
||||||
afx_msg void OnBUTTONTest50();
|
afx_msg void OnBUTTONTest50();
|
||||||
afx_msg void OnUpdateBUTTONTest1(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest1(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest2(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest2(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest3(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest3(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest4(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest4(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest5(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest5(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest6(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest6(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest7(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest7(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest8(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest8(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest9(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest9(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest10(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest10(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest11(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest11(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest12(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest12(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest13(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest13(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest14(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest14(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest15(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest15(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest16(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest16(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest17(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest17(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest18(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest18(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest19(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest19(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest20(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest20(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest21(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest21(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest22(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest22(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest23(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest23(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest24(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest24(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest25(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest25(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest26(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest26(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest27(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest27(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest28(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest28(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest29(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest29(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest30(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest30(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest31(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest31(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest32(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest32(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest33(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest33(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest34(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest34(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest35(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest35(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest36(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest36(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest37(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest37(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest38(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest38(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest39(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest39(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest40(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest40(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest41(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest41(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest42(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest42(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest43(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest43(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest44(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest44(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest45(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest45(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest46(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest46(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest47(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest47(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest48(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest48(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest49(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest49(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnUpdateBUTTONTest50(CCmdUI* pCmdUI);
|
afx_msg void OnUpdateBUTTONTest50(CCmdUI* pCmdUI);
|
||||||
afx_msg void OnCreateSol();
|
afx_msg void OnCreateSol();
|
||||||
afx_msg void OnSimplify();
|
afx_msg void OnSimplify();
|
||||||
//}}AFX_MSG
|
//}}AFX_MSG
|
||||||
DECLARE_MESSAGE_MAP()
|
DECLARE_MESSAGE_MAP()
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Handle_V3d_Viewer myViewer;
|
Handle_V3d_Viewer myViewer;
|
||||||
Handle_V3d_Viewer myViewerCollector;
|
Handle_V3d_Viewer myViewerCollector;
|
||||||
Handle_AIS_InteractiveContext myAISContext;
|
Handle_AIS_InteractiveContext myAISContext;
|
||||||
public :
|
public :
|
||||||
Handle_AIS_InteractiveContext& GetAISContext(){ return myAISContext; };
|
Handle_AIS_InteractiveContext& GetAISContext(){ return myAISContext; };
|
||||||
Handle_V3d_Viewer GetViewer() { return myViewer; };
|
Handle_V3d_Viewer GetViewer() { return myViewer; };
|
||||||
Handle_V3d_Viewer GetViewerCollector() { return myViewerCollector; };
|
Handle_V3d_Viewer GetViewerCollector() { return myViewerCollector; };
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Handle_V2d_Viewer myViewer2D;
|
Handle_V2d_Viewer myViewer2D;
|
||||||
Handle_ISession2D_InteractiveContext myISessionContext;
|
Handle_ISession2D_InteractiveContext myISessionContext;
|
||||||
public :
|
public :
|
||||||
int Current;
|
int Current;
|
||||||
void Minimize3D();
|
void Minimize3D();
|
||||||
void Minimize2D();
|
void Minimize2D();
|
||||||
Handle_V2d_Viewer GetViewer2D() { return myViewer2D; };
|
Handle_V2d_Viewer GetViewer2D() { return myViewer2D; };
|
||||||
Handle_ISession2D_InteractiveContext& GetISessionContext(){ return myISessionContext; };
|
Handle_ISession2D_InteractiveContext& GetISessionContext(){ return myISessionContext; };
|
||||||
BOOL FitMode;
|
BOOL FitMode;
|
||||||
|
|
||||||
public :
|
public :
|
||||||
CResultDialog myCResultDialog;
|
CResultDialog myCResultDialog;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#endif // !defined(AFX_VIEWERDOC_H__4EF39FBA_4EBB_11D1_8D67_0800369C8A03__INCLUDED_)
|
#endif // !defined(AFX_VIEWERDOC_H__4EF39FBA_4EBB_11D1_8D67_0800369C8A03__INCLUDED_)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <AIS_InteractiveContext.hxx>
|
#include <AIS_InteractiveContext.hxx>
|
||||||
#include <OSD_Timer.hxx>
|
#include <OSD_Timer.hxx>
|
||||||
#include <Graphic3d_ArrayOfPrimitives.hxx>
|
#include <Graphic3d_ArrayOfPrimitives.hxx>
|
||||||
@ -15,14 +15,14 @@
|
|||||||
#include <Sphere_Sphere.hxx>
|
#include <Sphere_Sphere.hxx>
|
||||||
#include <AIS_Trihedron.hxx>
|
#include <AIS_Trihedron.hxx>
|
||||||
|
|
||||||
#include <qapplication.h>
|
#include <qapplication.h>
|
||||||
#include <qframe.h>
|
#include <qframe.h>
|
||||||
#include <qworkspace.h>
|
#include <qworkspace.h>
|
||||||
#include <qstatusbar.h>
|
#include <qstatusbar.h>
|
||||||
#include <qmenubar.h>
|
#include <qmenubar.h>
|
||||||
#include <qmessagebox.h>
|
#include <qmessagebox.h>
|
||||||
#include <qtextedit.h>
|
#include <qtextedit.h>
|
||||||
#include <qlayout.h>
|
#include <qlayout.h>
|
||||||
#include <qevent.h>
|
#include <qevent.h>
|
||||||
|
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
@ -44,15 +44,15 @@ Application::Application() : QMainWindow( 0 )
|
|||||||
stApp = this;
|
stApp = this;
|
||||||
myIsDocuments = false;
|
myIsDocuments = false;
|
||||||
|
|
||||||
// create and define the central widget
|
// create and define the central widget
|
||||||
QFrame* vBox = new QFrame( this );
|
QFrame* vBox = new QFrame( this );
|
||||||
vBox->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
|
vBox->setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
|
||||||
QVBoxLayout* main = new QVBoxLayout( vBox );
|
QVBoxLayout* main = new QVBoxLayout( vBox );
|
||||||
main->setMargin( 0 );
|
main->setMargin( 0 );
|
||||||
|
|
||||||
myWorkSpace = new QWorkspace( vBox );
|
myWorkSpace = new QWorkspace( vBox );
|
||||||
main->addWidget( myWorkSpace );
|
main->addWidget( myWorkSpace );
|
||||||
setCentralWidget( vBox );
|
setCentralWidget( vBox );
|
||||||
|
|
||||||
createActions();
|
createActions();
|
||||||
createCCActions();
|
createCCActions();
|
||||||
@ -66,12 +66,12 @@ Application::Application() : QMainWindow( 0 )
|
|||||||
myOutput->show();
|
myOutput->show();
|
||||||
#else
|
#else
|
||||||
myOutput = 0;
|
myOutput = 0;
|
||||||
#endif
|
#endif
|
||||||
myViewDlg = NULL;
|
myViewDlg = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Application::~Application()
|
Application::~Application()
|
||||||
{
|
{
|
||||||
if (myViewDlg) delete myViewDlg;
|
if (myViewDlg) delete myViewDlg;
|
||||||
if (myOutput) delete myOutput;
|
if (myOutput) delete myOutput;
|
||||||
}
|
}
|
||||||
@ -83,13 +83,13 @@ void Application::createActions()
|
|||||||
helpIcon( dir + tr( "ICON_HELP" ) ),
|
helpIcon( dir + tr( "ICON_HELP" ) ),
|
||||||
closeIcon( dir + tr( "ICON_CLOSE" ) ),
|
closeIcon( dir + tr( "ICON_CLOSE" ) ),
|
||||||
autoIcon( dir + tr( "ICON_AUTO_TEST" ) ),
|
autoIcon( dir + tr( "ICON_AUTO_TEST" ) ),
|
||||||
optimIcon( dir + tr( "ICON_OPTIM" ) ),
|
optimIcon( dir + tr( "ICON_OPTIM" ) ),
|
||||||
stopIcon( dir + tr( "ICON_STOP" ) ),
|
stopIcon( dir + tr( "ICON_STOP" ) ),
|
||||||
tileIcon( dir + tr( "ICON_TILE" ) ),
|
tileIcon( dir + tr( "ICON_TILE" ) ),
|
||||||
cascadeIcon( dir + tr( "ICON_CASCADE" ) );
|
cascadeIcon( dir + tr( "ICON_CASCADE" ) );
|
||||||
|
|
||||||
// toolbar with standard actions: new, save...
|
// toolbar with standard actions: new, save...
|
||||||
myStdToolBar = new QToolBar( this );
|
myStdToolBar = new QToolBar( this );
|
||||||
addToolBar( Qt::TopToolBarArea, myStdToolBar );
|
addToolBar( Qt::TopToolBarArea, myStdToolBar );
|
||||||
|
|
||||||
// menu with all actions
|
// menu with all actions
|
||||||
@ -110,78 +110,78 @@ void Application::createActions()
|
|||||||
QMenu* help = menuBar()->addMenu( tr( "MEN_HELP" ) );
|
QMenu* help = menuBar()->addMenu( tr( "MEN_HELP" ) );
|
||||||
menuBar()->addSeparator();
|
menuBar()->addSeparator();
|
||||||
|
|
||||||
QAction* a = new QAction( newIcon, tr( "MEN_NEW" ), this );
|
QAction* a = new QAction( newIcon, tr( "MEN_NEW" ), this );
|
||||||
a->setToolTip( tr( "TBR_NEW" ) );
|
a->setToolTip( tr( "TBR_NEW" ) );
|
||||||
a->setShortcut( Qt::CTRL+Qt::Key_N );
|
a->setShortcut( Qt::CTRL+Qt::Key_N );
|
||||||
verify( connect( a, SIGNAL( activated() ), this, SLOT( onNewDocument() ) ) );
|
verify( connect( a, SIGNAL( activated() ), this, SLOT( onNewDocument() ) ) );
|
||||||
myStdActions.insert( FileNewId, a );
|
myStdActions.insert( FileNewId, a );
|
||||||
myStdToolBar->addAction( a );
|
myStdToolBar->addAction( a );
|
||||||
myFilePopup ->addAction( a );
|
myFilePopup ->addAction( a );
|
||||||
|
|
||||||
a = new QAction( tr( "MEN_QUIT" ), this );
|
a = new QAction( tr( "MEN_QUIT" ), this );
|
||||||
a->setShortcut( Qt::CTRL+Qt::Key_Q );
|
a->setShortcut( Qt::CTRL+Qt::Key_Q );
|
||||||
a->setToolTip( tr( "TBR_QUIT" ) );
|
a->setToolTip( tr( "TBR_QUIT" ) );
|
||||||
verify( connect( a, SIGNAL( activated() ), qApp, SLOT( closeAllWindows() ) ) );
|
verify( connect( a, SIGNAL( activated() ), qApp, SLOT( closeAllWindows() ) ) );
|
||||||
myStdActions.insert( FileQuitId, a );
|
myStdActions.insert( FileQuitId, a );
|
||||||
myFilePopup ->addAction( a );
|
myFilePopup ->addAction( a );
|
||||||
|
|
||||||
a = new QAction( tr( "MEN_TOOL_BAR" ), this );
|
a = new QAction( tr( "MEN_TOOL_BAR" ), this );
|
||||||
a->setToolTip( tr( "TBR_TOOL_BAR" ) );
|
a->setToolTip( tr( "TBR_TOOL_BAR" ) );
|
||||||
verify( connect( a, SIGNAL( activated() ), this, SLOT( onViewToolBar() ) ) );
|
verify( connect( a, SIGNAL( activated() ), this, SLOT( onViewToolBar() ) ) );
|
||||||
a->setCheckable(true);
|
a->setCheckable(true);
|
||||||
a->setChecked( true );
|
a->setChecked( true );
|
||||||
myStdActions.insert( ViewToolId, a );
|
myStdActions.insert( ViewToolId, a );
|
||||||
view->addAction( a );
|
view->addAction( a );
|
||||||
|
|
||||||
a = new QAction( tr("MEN_STATUS_BAR"), this );
|
a = new QAction( tr("MEN_STATUS_BAR"), this );
|
||||||
a->setToolTip( tr( "TBR_STATUS_BAR" ) );
|
a->setToolTip( tr( "TBR_STATUS_BAR" ) );
|
||||||
verify( connect( a, SIGNAL( activated() ), this, SLOT( onViewStatusBar() ) ) );
|
verify( connect( a, SIGNAL( activated() ), this, SLOT( onViewStatusBar() ) ) );
|
||||||
a->setCheckable(true);
|
a->setCheckable(true);
|
||||||
a->setChecked( true );
|
a->setChecked( true );
|
||||||
myStdActions.insert( ViewStatusId, a );
|
myStdActions.insert( ViewStatusId, a );
|
||||||
view->addAction( a );
|
view->addAction( a );
|
||||||
|
|
||||||
a = new QAction( helpIcon, tr( "MEN_ABOUT" ), this );
|
a = new QAction( helpIcon, tr( "MEN_ABOUT" ), this );
|
||||||
a->setShortcut( Qt::Key_F1 );
|
a->setShortcut( Qt::Key_F1 );
|
||||||
a->setToolTip( tr( "TBR_ABOUT" ) );
|
a->setToolTip( tr( "TBR_ABOUT" ) );
|
||||||
verify( connect( a, SIGNAL( activated() ) , this, SLOT( onAbout() ) ) );
|
verify( connect( a, SIGNAL( activated() ) , this, SLOT( onAbout() ) ) );
|
||||||
myStdActions.insert( HelpAboutId, a );
|
myStdActions.insert( HelpAboutId, a );
|
||||||
myStdToolBar->addAction( a );
|
myStdToolBar->addAction( a );
|
||||||
help->addAction( a );
|
help->addAction( a );
|
||||||
|
|
||||||
myStdToolBar->addSeparator();
|
myStdToolBar->addSeparator();
|
||||||
|
|
||||||
// Tools menu actions
|
// Tools menu actions
|
||||||
a = new QAction( optimIcon, tr( "MEN_OPTIM" ), this );
|
a = new QAction( optimIcon, tr( "MEN_OPTIM" ), this );
|
||||||
a->setToolTip( tr( "TBR_OPTIM" ) );
|
a->setToolTip( tr( "TBR_OPTIM" ) );
|
||||||
verify( connect( a, SIGNAL( toggled(bool) ) , this, SLOT( onToggleOptim(bool) ) ) );
|
verify( connect( a, SIGNAL( toggled(bool) ) , this, SLOT( onToggleOptim(bool) ) ) );
|
||||||
a->setCheckable(true);
|
a->setCheckable(true);
|
||||||
a->setChecked(Graphic3d_ArrayOfPrimitives::IsEnable());
|
a->setChecked(Graphic3d_ArrayOfPrimitives::IsEnable());
|
||||||
myStdActions.insert( OptimId, a );
|
myStdActions.insert( OptimId, a );
|
||||||
myToolsMenu->addAction( a );
|
myToolsMenu->addAction( a );
|
||||||
|
|
||||||
a = new QAction( autoIcon, tr( "TBR_AUTO_TEST" ), this );
|
a = new QAction( autoIcon, tr( "TBR_AUTO_TEST" ), this );
|
||||||
a->setToolTip( tr( "TBR_AUTO_TEST" ) );
|
a->setToolTip( tr( "TBR_AUTO_TEST" ) );
|
||||||
verify( connect( a, SIGNAL( activated() ) , this, SLOT( onAutoTest() ) ) );
|
verify( connect( a, SIGNAL( activated() ) , this, SLOT( onAutoTest() ) ) );
|
||||||
myStdActions.insert( AutoTestId, a );
|
myStdActions.insert( AutoTestId, a );
|
||||||
myToolsMenu->addAction( a );
|
myToolsMenu->addAction( a );
|
||||||
|
|
||||||
a = new QAction( stopIcon, tr( "TBR_STOP" ), this );
|
a = new QAction( stopIcon, tr( "TBR_STOP" ), this );
|
||||||
a->setToolTip( tr( "TBR_STOP" ) );
|
a->setToolTip( tr( "TBR_STOP" ) );
|
||||||
verify( connect( a, SIGNAL( activated() ) , this, SLOT( onStop() ) ) );
|
verify( connect( a, SIGNAL( activated() ) , this, SLOT( onStop() ) ) );
|
||||||
myStdActions.insert( StopId, a );
|
myStdActions.insert( StopId, a );
|
||||||
myToolsMenu->addAction( a );
|
myToolsMenu->addAction( a );
|
||||||
|
|
||||||
// Window menu action
|
// Window menu action
|
||||||
a = new QAction( cascadeIcon, tr( "MEN_CASCADE" ), this );
|
a = new QAction( cascadeIcon, tr( "MEN_CASCADE" ), this );
|
||||||
verify( connect( a, SIGNAL( activated() ) , myWorkSpace, SLOT( cascade() ) ) );
|
verify( connect( a, SIGNAL( activated() ) , myWorkSpace, SLOT( cascade() ) ) );
|
||||||
myStdActions.insert( CascadeId, a );
|
myStdActions.insert( CascadeId, a );
|
||||||
myWinMenu->addAction( a );
|
myWinMenu->addAction( a );
|
||||||
|
|
||||||
a = new QAction( tileIcon, tr( "MEN_TILE" ), this );
|
a = new QAction( tileIcon, tr( "MEN_TILE" ), this );
|
||||||
verify( connect( a, SIGNAL( activated() ), myWorkSpace, SLOT( tile() ) ) );
|
verify( connect( a, SIGNAL( activated() ), myWorkSpace, SLOT( tile() ) ) );
|
||||||
myStdActions.insert( TileId, a );
|
myStdActions.insert( TileId, a );
|
||||||
myWinMenu->addAction( a );
|
myWinMenu->addAction( a );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -194,7 +194,7 @@ void Application::createIEPopups()
|
|||||||
{
|
{
|
||||||
myImportPopup = new QMenu( tr( "MEN_FILE_IMPORT" ), this );
|
myImportPopup = new QMenu( tr( "MEN_FILE_IMPORT" ), this );
|
||||||
|
|
||||||
QAction* a = new QAction( tr( "MEN_IMPORT_BREP" ), this );
|
QAction* a = new QAction( tr( "MEN_IMPORT_BREP" ), this );
|
||||||
a->setToolTip( tr( "TBR_IMPORT_BREP" ) );
|
a->setToolTip( tr( "TBR_IMPORT_BREP" ) );
|
||||||
verify( connect( a, SIGNAL( activated() ) , SLOT( onTranslate() ) ) );
|
verify( connect( a, SIGNAL( activated() ) , SLOT( onTranslate() ) ) );
|
||||||
myCCActions.insert( FileImportBREPId, a );
|
myCCActions.insert( FileImportBREPId, a );
|
||||||
@ -223,8 +223,8 @@ void Application::updateWindowList()
|
|||||||
for ( int i = 0; i < int(lst.count()); ++i )
|
for ( int i = 0; i < int(lst.count()); ++i )
|
||||||
{
|
{
|
||||||
QAction* a = myWinMenu->addAction( lst.at(i)->windowTitle(),
|
QAction* a = myWinMenu->addAction( lst.at(i)->windowTitle(),
|
||||||
this, SLOT( activateWindow() ) );
|
this, SLOT( activateWindow() ) );
|
||||||
a->setCheckable( true );
|
a->setCheckable( true );
|
||||||
a->setChecked( myWorkSpace->activeWindow() == lst.at(i) );
|
a->setChecked( myWorkSpace->activeWindow() == lst.at(i) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -232,14 +232,14 @@ void Application::updateWindowList()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Application::activateWindow()
|
void Application::activateWindow()
|
||||||
{
|
{
|
||||||
QAction* a = qobject_cast<QAction*>( sender() );
|
QAction* a = qobject_cast<QAction*>( sender() );
|
||||||
if ( !a ) return;
|
if ( !a ) return;
|
||||||
int idx = myWinMenu->actions().indexOf( a ) - 3; // tile, cascade and separator
|
int idx = myWinMenu->actions().indexOf( a ) - 3; // tile, cascade and separator
|
||||||
QWidget* w = myWorkSpace->windowList().at( idx );
|
QWidget* w = myWorkSpace->windowList().at( idx );
|
||||||
if ( w ) {
|
if ( w ) {
|
||||||
w->showNormal();
|
w->showNormal();
|
||||||
w->setFocus();
|
w->setFocus();
|
||||||
// w->setActiveWindow();
|
// w->setActiveWindow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -256,7 +256,7 @@ void Application::updateActions()
|
|||||||
{
|
{
|
||||||
QAction* optim = myStdActions.at(OptimId);
|
QAction* optim = myStdActions.at(OptimId);
|
||||||
QAction* autoTest = myStdActions.at(AutoTestId);
|
QAction* autoTest = myStdActions.at(AutoTestId);
|
||||||
QAction* stop = myStdActions.at(StopId);
|
QAction* stop = myStdActions.at(StopId);
|
||||||
|
|
||||||
if( myNbDocuments ) {
|
if( myNbDocuments ) {
|
||||||
myFilePopup->insertMenu( myFilePopup->actions().last(), myImportPopup );
|
myFilePopup->insertMenu( myFilePopup->actions().last(), myImportPopup );
|
||||||
@ -266,7 +266,7 @@ void Application::updateActions()
|
|||||||
|
|
||||||
if (optim) myStdToolBar->addAction( optim );
|
if (optim) myStdToolBar->addAction( optim );
|
||||||
if (autoTest) myStdToolBar->addAction( autoTest );
|
if (autoTest) myStdToolBar->addAction( autoTest );
|
||||||
if (stop) myStdToolBar->addAction( stop );
|
if (stop) myStdToolBar->addAction( stop );
|
||||||
stop->setEnabled(false);
|
stop->setEnabled(false);
|
||||||
myIsDocuments = true;
|
myIsDocuments = true;
|
||||||
}
|
}
|
||||||
@ -380,10 +380,10 @@ void Application::onViewStatusBar()
|
|||||||
{
|
{
|
||||||
bool show = myStdActions.at( ViewStatusId )->isChecked();
|
bool show = myStdActions.at( ViewStatusId )->isChecked();
|
||||||
if ( show == statusBar()->isVisible() )
|
if ( show == statusBar()->isVisible() )
|
||||||
return;
|
return;
|
||||||
if ( show )
|
if ( show )
|
||||||
statusBar()->show();
|
statusBar()->show();
|
||||||
else
|
else
|
||||||
statusBar()->hide();
|
statusBar()->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -413,13 +413,13 @@ MDIWindow* Application::getActiveMDI()
|
|||||||
void Application::onWindowActivated( QWidget* w )
|
void Application::onWindowActivated( QWidget* w )
|
||||||
{
|
{
|
||||||
if ( w != NULL && w->inherits( "MDIWindow" ) ){
|
if ( w != NULL && w->inherits( "MDIWindow" ) ){
|
||||||
myActiveMDI = (MDIWindow*)w;
|
myActiveMDI = (MDIWindow*)w;
|
||||||
w->setFocus();
|
w->setFocus();
|
||||||
}
|
}
|
||||||
else if (myViewDlg)
|
else if (myViewDlg)
|
||||||
{
|
{
|
||||||
delete myViewDlg; myViewDlg = NULL;
|
delete myViewDlg; myViewDlg = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::startTimer()
|
void Application::startTimer()
|
||||||
@ -455,11 +455,11 @@ void Application::stopTimer( int count, const char* mes, bool addToGraph, int aO
|
|||||||
{
|
{
|
||||||
QString qmes(mes);
|
QString qmes(mes);
|
||||||
MDIWindow::ResultType type = MDIWindow::Undefined;
|
MDIWindow::ResultType type = MDIWindow::Undefined;
|
||||||
bool isOptOn = false;
|
bool isOptOn = false;
|
||||||
if(aOpt >= 0) {
|
if(aOpt >= 0) {
|
||||||
isOptOn |= (aOpt > 0);
|
isOptOn |= (aOpt > 0);
|
||||||
} else {
|
} else {
|
||||||
isOptOn = Graphic3d_ArrayOfPrimitives::IsEnable();
|
isOptOn = Graphic3d_ArrayOfPrimitives::IsEnable();
|
||||||
}
|
}
|
||||||
if (qmes.contains(tr("MES_DISPLAY"), Qt::CaseInsensitive))
|
if (qmes.contains(tr("MES_DISPLAY"), Qt::CaseInsensitive))
|
||||||
type = isOptOn ? MDIWindow::DisplayOpt : MDIWindow::DisplayNonOpt;
|
type = isOptOn ? MDIWindow::DisplayOpt : MDIWindow::DisplayNonOpt;
|
||||||
@ -551,11 +551,11 @@ void Application::addResult(MDIWindow::ResultType item, double value)
|
|||||||
activeWin->addResult(item, nbTriangles, value);
|
activeWin->addResult(item, nbTriangles, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
QWorkspace* Application::workspace() const
|
QWorkspace* Application::workspace() const
|
||||||
{
|
{
|
||||||
return myWorkSpace;
|
return myWorkSpace;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::keyPressEvent(QKeyEvent* e)
|
void Application::keyPressEvent(QKeyEvent* e)
|
||||||
{
|
{
|
||||||
if (e->key() == Qt::Key_Escape)
|
if (e->key() == Qt::Key_Escape)
|
||||||
@ -568,16 +568,16 @@ void Application::onAutoTest()
|
|||||||
if (autoDlg.exec() == QDialog::Accepted)
|
if (autoDlg.exec() == QDialog::Accepted)
|
||||||
{
|
{
|
||||||
QApplication::setOverrideCursor( Qt::WaitCursor );
|
QApplication::setOverrideCursor( Qt::WaitCursor );
|
||||||
myEscPressed = false;
|
myEscPressed = false;
|
||||||
myStopPressed = false;
|
myStopPressed = false;
|
||||||
QAction* stop = myStdActions.at(StopId);
|
QAction* stop = myStdActions.at(StopId);
|
||||||
|
|
||||||
stop->setEnabled(true);
|
stop->setEnabled(true);
|
||||||
|
|
||||||
// Define the range for testing
|
// Define the range for testing
|
||||||
int startItems = autoDlg.getStartNbItems();
|
int startItems = autoDlg.getStartNbItems();
|
||||||
int stopItems = autoDlg.getStopNbItems();
|
int stopItems = autoDlg.getStopNbItems();
|
||||||
int step = autoDlg.getStep();
|
int step = autoDlg.getStep();
|
||||||
bool isTe = autoDlg.isText();
|
bool isTe = autoDlg.isText();
|
||||||
if (stopItems < startItems) stopItems = startItems;
|
if (stopItems < startItems) stopItems = startItems;
|
||||||
|
|
||||||
@ -593,7 +593,7 @@ void Application::onAutoTest()
|
|||||||
qApp->processEvents();
|
qApp->processEvents();
|
||||||
if (myEscPressed || myStopPressed)
|
if (myEscPressed || myStopPressed)
|
||||||
{
|
{
|
||||||
QApplication::restoreOverrideCursor();
|
QApplication::restoreOverrideCursor();
|
||||||
stop->setEnabled(false);
|
stop->setEnabled(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -611,8 +611,8 @@ void Application::onAutoTest()
|
|||||||
if (!obj->IsKind(STANDARD_TYPE(AIS_Trihedron)))
|
if (!obj->IsKind(STANDARD_TYPE(AIS_Trihedron)))
|
||||||
ctx->Remove(obj, false);
|
ctx->Remove(obj, false);
|
||||||
}
|
}
|
||||||
ctx->UpdateCurrentViewer();
|
ctx->UpdateCurrentViewer();
|
||||||
|
|
||||||
getActiveMDI()->getView()->SetScale(3.0316);
|
getActiveMDI()->getView()->SetScale(3.0316);
|
||||||
|
|
||||||
// Generate new sphere
|
// Generate new sphere
|
||||||
@ -627,21 +627,21 @@ void Application::onAutoTest()
|
|||||||
ctx->Display( sphere, false );
|
ctx->Display( sphere, false );
|
||||||
Application::stopTimer( 0, "Display Sphere::Sphere", true, useOptim);
|
Application::stopTimer( 0, "Display Sphere::Sphere", true, useOptim);
|
||||||
|
|
||||||
qApp->processEvents();
|
qApp->processEvents();
|
||||||
if (myEscPressed || myStopPressed)
|
if (myEscPressed || myStopPressed)
|
||||||
{
|
{
|
||||||
QApplication::restoreOverrideCursor();
|
QApplication::restoreOverrideCursor();
|
||||||
stop->setEnabled(false);
|
stop->setEnabled(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the viewer
|
// Update the viewer
|
||||||
Application::startTimer();
|
Application::startTimer();
|
||||||
getActiveMDI()->getView()->Update();
|
getActiveMDI()->getView()->Update();
|
||||||
Application::stopTimer( 0, "UPDATE", true, useOptim);
|
Application::stopTimer( 0, "UPDATE", true, useOptim);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QApplication::restoreOverrideCursor();
|
QApplication::restoreOverrideCursor();
|
||||||
stop->setEnabled(false);
|
stop->setEnabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -667,29 +667,29 @@ void OutputWindow::print( QString& s )
|
|||||||
myLineEdit->append( QString().setNum( myLineCounter ) + s );
|
myLineEdit->append( QString().setNum( myLineCounter ) + s );
|
||||||
myLineCounter++;
|
myLineCounter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::InitApp()
|
void Application::InitApp()
|
||||||
{
|
{
|
||||||
onNewDocument();
|
onNewDocument();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::onStop()
|
void Application::onStop()
|
||||||
{
|
{
|
||||||
myStopPressed = true;
|
myStopPressed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::onEditViewProperties()
|
void Application::onEditViewProperties()
|
||||||
{
|
{
|
||||||
if ( !myViewDlg ) {
|
if ( !myViewDlg ) {
|
||||||
myViewDlg = new ViewDlg(this);
|
myViewDlg = new ViewDlg(this);
|
||||||
verify( connect( myWorkSpace, SIGNAL( windowActivated( QWidget* ) ),
|
verify( connect( myWorkSpace, SIGNAL( windowActivated( QWidget* ) ),
|
||||||
myViewDlg, SLOT( Update() ) ) );
|
myViewDlg, SLOT( Update() ) ) );
|
||||||
}
|
}
|
||||||
myViewDlg->raise();
|
myViewDlg->raise();
|
||||||
myViewDlg->show();
|
myViewDlg->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::updateViewDlg()
|
void Application::updateViewDlg()
|
||||||
{
|
{
|
||||||
if(myViewDlg) myViewDlg->Update();
|
if(myViewDlg) myViewDlg->Update();
|
||||||
}
|
}
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
AutoTestDlg::AutoTestDlg(QWidget* parent)
|
AutoTestDlg::AutoTestDlg(QWidget* parent)
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
{
|
{
|
||||||
setModal( true );
|
setModal( true );
|
||||||
setWindowTitle(tr("DLG_AUTO_TEST"));
|
setWindowTitle(tr("DLG_AUTO_TEST"));
|
||||||
QString dir = Application::getResourceDir();
|
QString dir = Application::getResourceDir();
|
||||||
@ -26,37 +26,37 @@ AutoTestDlg::AutoTestDlg(QWidget* parent)
|
|||||||
pMainLayout->addWidget(lab, 1, 0);
|
pMainLayout->addWidget(lab, 1, 0);
|
||||||
|
|
||||||
lab = new QLabel(tr("LAB_STEP"), this);
|
lab = new QLabel(tr("LAB_STEP"), this);
|
||||||
pMainLayout->addWidget(lab, 2, 0);
|
pMainLayout->addWidget(lab, 2, 0);
|
||||||
|
|
||||||
const int MinNbOfItems = 100000; // to see noticable effect
|
const int MinNbOfItems = 100000; // to see noticable effect
|
||||||
const int MaxNbOfItems = 1000000; // to avoid too long computations
|
const int MaxNbOfItems = 1000000; // to avoid too long computations
|
||||||
const int ItemsStep = 100000;
|
const int ItemsStep = 100000;
|
||||||
const int MinStep = 50000;
|
const int MinStep = 50000;
|
||||||
const int StepStep = 50000;
|
const int StepStep = 50000;
|
||||||
|
|
||||||
myStartSpin = new QSpinBox(this);
|
myStartSpin = new QSpinBox(this);
|
||||||
myStartSpin->setMinimum(MinNbOfItems);
|
myStartSpin->setMinimum(MinNbOfItems);
|
||||||
myStartSpin->setMaximum(MaxNbOfItems);
|
myStartSpin->setMaximum(MaxNbOfItems);
|
||||||
myStartSpin->setSingleStep(ItemsStep);
|
myStartSpin->setSingleStep(ItemsStep);
|
||||||
pMainLayout->addWidget(myStartSpin, 0, 1);
|
pMainLayout->addWidget(myStartSpin, 0, 1);
|
||||||
verify(connect(myStartSpin, SIGNAL(valueChanged(int)), SLOT(checkStepSpinState())));
|
verify(connect(myStartSpin, SIGNAL(valueChanged(int)), SLOT(checkStepSpinState())));
|
||||||
|
|
||||||
myStopSpin = new QSpinBox(this);
|
myStopSpin = new QSpinBox(this);
|
||||||
myStopSpin->setMinimum(MinNbOfItems);
|
myStopSpin->setMinimum(MinNbOfItems);
|
||||||
myStopSpin->setMaximum(MaxNbOfItems);
|
myStopSpin->setMaximum(MaxNbOfItems);
|
||||||
myStartSpin->setSingleStep(ItemsStep);
|
myStartSpin->setSingleStep(ItemsStep);
|
||||||
pMainLayout->addWidget(myStopSpin, 1, 1);
|
pMainLayout->addWidget(myStopSpin, 1, 1);
|
||||||
verify(connect(myStopSpin, SIGNAL(valueChanged(int)), SLOT(setStartMaxValue(int))));
|
verify(connect(myStopSpin, SIGNAL(valueChanged(int)), SLOT(setStartMaxValue(int))));
|
||||||
verify(connect(myStopSpin, SIGNAL(valueChanged(int)), SLOT(checkStepSpinState())));
|
verify(connect(myStopSpin, SIGNAL(valueChanged(int)), SLOT(checkStepSpinState())));
|
||||||
|
|
||||||
const int StopSpinDefaultValue = 2 * myStartSpin -> minimum();
|
const int StopSpinDefaultValue = 2 * myStartSpin -> minimum();
|
||||||
myStopSpin -> setValue(StopSpinDefaultValue);
|
myStopSpin -> setValue(StopSpinDefaultValue);
|
||||||
myStartSpin -> setMaximum(myStopSpin -> value());
|
myStartSpin -> setMaximum(myStopSpin -> value());
|
||||||
|
|
||||||
myStepSpin = new QSpinBox(this);
|
myStepSpin = new QSpinBox(this);
|
||||||
myStepSpin->setMinimum(MinStep);
|
myStepSpin->setMinimum(MinStep);
|
||||||
myStepSpin->setMaximum(MaxNbOfItems - MinNbOfItems);
|
myStepSpin->setMaximum(MaxNbOfItems - MinNbOfItems);
|
||||||
myStepSpin->setSingleStep(StepStep);
|
myStepSpin->setSingleStep(StepStep);
|
||||||
pMainLayout->addWidget(myStepSpin, 2, 1);
|
pMainLayout->addWidget(myStepSpin, 2, 1);
|
||||||
|
|
||||||
lab = new QLabel(tr("LAB_ITEMS"), this);
|
lab = new QLabel(tr("LAB_ITEMS"), this);
|
||||||
@ -68,24 +68,24 @@ AutoTestDlg::AutoTestDlg(QWidget* parent)
|
|||||||
lab = new QLabel(tr("LAB_ITEMS"), this);
|
lab = new QLabel(tr("LAB_ITEMS"), this);
|
||||||
pMainLayout->addWidget(lab, 2, 2);
|
pMainLayout->addWidget(lab, 2, 2);
|
||||||
|
|
||||||
QFrame* separator = new QFrame(this);
|
QFrame* separator = new QFrame(this);
|
||||||
separator->setFrameStyle(QFrame::HLine | QFrame::Sunken);
|
separator->setFrameStyle(QFrame::HLine | QFrame::Sunken);
|
||||||
pMainLayout->addWidget(separator, 3, 0, 1, 3 );
|
pMainLayout->addWidget(separator, 3, 0, 1, 3 );
|
||||||
|
|
||||||
QHBoxLayout* hcbox = new QHBoxLayout();
|
QHBoxLayout* hcbox = new QHBoxLayout();
|
||||||
hcbox->setSpacing(5);
|
hcbox->setSpacing(5);
|
||||||
|
|
||||||
myTeCheck = new QCheckBox(tr( "MEN_BTN_TEXT" ), this);
|
myTeCheck = new QCheckBox(tr( "MEN_BTN_TEXT" ), this);
|
||||||
hcbox->addWidget(myTeCheck);
|
hcbox->addWidget(myTeCheck);
|
||||||
verify(connect(myTeCheck, SIGNAL(clicked()), this, SLOT(onText())));
|
verify(connect(myTeCheck, SIGNAL(clicked()), this, SLOT(onText())));
|
||||||
|
|
||||||
hcbox->addSpacing( 5 );
|
hcbox->addSpacing( 5 );
|
||||||
|
|
||||||
pMainLayout->addLayout(hcbox, 4, 0, 1, 3);
|
pMainLayout->addLayout(hcbox, 4, 0, 1, 3);
|
||||||
|
|
||||||
QHBoxLayout* hbox = new QHBoxLayout();
|
QHBoxLayout* hbox = new QHBoxLayout();
|
||||||
hbox->setSpacing(5);
|
hbox->setSpacing(5);
|
||||||
|
|
||||||
QPushButton* btn = new QPushButton(tr("BTN_START"), this);
|
QPushButton* btn = new QPushButton(tr("BTN_START"), this);
|
||||||
// btn->setDefault(true);
|
// btn->setDefault(true);
|
||||||
verify(connect(btn, SIGNAL(clicked()), this, SLOT(onStart())));
|
verify(connect(btn, SIGNAL(clicked()), this, SLOT(onStart())));
|
||||||
@ -96,7 +96,7 @@ AutoTestDlg::AutoTestDlg(QWidget* parent)
|
|||||||
btn->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
|
btn->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
|
||||||
hbox->addWidget(btn);
|
hbox->addWidget(btn);
|
||||||
hbox->addSpacing(5);
|
hbox->addSpacing(5);
|
||||||
pMainLayout->addLayout(hbox, 5, 0, 1, 3);
|
pMainLayout->addLayout(hbox, 5, 0, 1, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoTestDlg::onStart()
|
void AutoTestDlg::onStart()
|
||||||
@ -107,63 +107,63 @@ void AutoTestDlg::onStart()
|
|||||||
void AutoTestDlg::onCancel()
|
void AutoTestDlg::onCancel()
|
||||||
{
|
{
|
||||||
reject();
|
reject();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoTestDlg::setStartMaxValue(int i)
|
void AutoTestDlg::setStartMaxValue(int i)
|
||||||
{
|
{
|
||||||
myStartSpin -> setMaximum(i);
|
myStartSpin -> setMaximum(i);
|
||||||
if (myStartSpin -> value() > myStartSpin -> maximum())
|
if (myStartSpin -> value() > myStartSpin -> maximum())
|
||||||
myStartSpin -> setValue(myStartSpin -> maximum());
|
myStartSpin -> setValue(myStartSpin -> maximum());
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoTestDlg::checkStepSpinState()
|
void AutoTestDlg::checkStepSpinState()
|
||||||
{
|
{
|
||||||
if (isVisible())
|
if (isVisible())
|
||||||
{
|
{
|
||||||
if (myStartSpin -> value() == myStopSpin -> value())
|
if (myStartSpin -> value() == myStopSpin -> value())
|
||||||
myStepSpin -> setEnabled(false);
|
myStepSpin -> setEnabled(false);
|
||||||
else
|
else
|
||||||
myStepSpin -> setEnabled(true);
|
myStepSpin -> setEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoTestDlg::onText()
|
void AutoTestDlg::onText()
|
||||||
{
|
{
|
||||||
int MinNbOfItems, MaxNbOfItems, DefaultStartSpinVal, DefaultStopSpinVal,
|
int MinNbOfItems, MaxNbOfItems, DefaultStartSpinVal, DefaultStopSpinVal,
|
||||||
ItemsStep, MinStep, StepStep;
|
ItemsStep, MinStep, StepStep;
|
||||||
|
|
||||||
if (myTeCheck -> isChecked())
|
if (myTeCheck -> isChecked())
|
||||||
{
|
{
|
||||||
MinNbOfItems = 1000; // to see noticeable effect
|
MinNbOfItems = 1000; // to see noticeable effect
|
||||||
MaxNbOfItems = 100000; // to avoid too long computations
|
MaxNbOfItems = 100000; // to avoid too long computations
|
||||||
DefaultStartSpinVal = 10000;
|
DefaultStartSpinVal = 10000;
|
||||||
DefaultStopSpinVal = 20000;
|
DefaultStopSpinVal = 20000;
|
||||||
ItemsStep = 10000;
|
ItemsStep = 10000;
|
||||||
MinStep = 5000;
|
MinStep = 5000;
|
||||||
StepStep = 5000;
|
StepStep = 5000;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MinNbOfItems = 100000; // to see noticeable effect
|
MinNbOfItems = 100000; // to see noticeable effect
|
||||||
MaxNbOfItems = 1000000; // to avoid too long computations
|
MaxNbOfItems = 1000000; // to avoid too long computations
|
||||||
DefaultStartSpinVal = 100000;
|
DefaultStartSpinVal = 100000;
|
||||||
DefaultStopSpinVal = 200000;
|
DefaultStopSpinVal = 200000;
|
||||||
ItemsStep = 100000;
|
ItemsStep = 100000;
|
||||||
MinStep = 50000;
|
MinStep = 50000;
|
||||||
StepStep = 50000;
|
StepStep = 50000;
|
||||||
}
|
}
|
||||||
|
|
||||||
myStartSpin -> setRange(MinNbOfItems, MaxNbOfItems);
|
myStartSpin -> setRange(MinNbOfItems, MaxNbOfItems);
|
||||||
myStartSpin -> setSingleStep(ItemsStep);
|
myStartSpin -> setSingleStep(ItemsStep);
|
||||||
myStartSpin -> setValue(DefaultStartSpinVal);
|
myStartSpin -> setValue(DefaultStartSpinVal);
|
||||||
|
|
||||||
myStopSpin -> setRange(MinNbOfItems, MaxNbOfItems);
|
myStopSpin -> setRange(MinNbOfItems, MaxNbOfItems);
|
||||||
myStopSpin -> setSingleStep(ItemsStep);
|
myStopSpin -> setSingleStep(ItemsStep);
|
||||||
|
|
||||||
myStopSpin -> setValue(DefaultStopSpinVal);
|
myStopSpin -> setValue(DefaultStopSpinVal);
|
||||||
myStartSpin -> setMaximum(myStopSpin -> value());
|
myStartSpin -> setMaximum(myStopSpin -> value());
|
||||||
|
|
||||||
myStepSpin -> setRange(MinStep, MaxNbOfItems - MinNbOfItems);
|
myStepSpin -> setRange(MinStep, MaxNbOfItems - MinNbOfItems);
|
||||||
myStepSpin -> setSingleStep(StepStep);
|
myStepSpin -> setSingleStep(StepStep);
|
||||||
myStepSpin -> setValue(MinStep);
|
myStepSpin -> setValue(MinStep);
|
||||||
}
|
}
|
@ -41,7 +41,7 @@ Handle(V3d_Viewer) Document::Viewer( const Standard_CString aDisplay,
|
|||||||
|
|
||||||
Document::Document( int theIndex, Application* app )
|
Document::Document( int theIndex, Application* app )
|
||||||
: QObject( app )
|
: QObject( app )
|
||||||
{
|
{
|
||||||
myIndex = theIndex;
|
myIndex = theIndex;
|
||||||
myNbViews = 0;
|
myNbViews = 0;
|
||||||
myApp = app;
|
myApp = app;
|
||||||
@ -51,16 +51,16 @@ Document::Document( int theIndex, Application* app )
|
|||||||
myViewer->SetDefaultLights();
|
myViewer->SetDefaultLights();
|
||||||
myViewer->SetLightOn();
|
myViewer->SetLightOn();
|
||||||
myViewer->SetZBufferManagment(false);
|
myViewer->SetZBufferManagment(false);
|
||||||
myContext = new AIS_InteractiveContext( myViewer );
|
myContext = new AIS_InteractiveContext( myViewer );
|
||||||
|
|
||||||
createNewView();
|
createNewView();
|
||||||
|
|
||||||
myOperations = new ViewOperations( myContext );
|
myOperations = new ViewOperations( myContext );
|
||||||
}
|
}
|
||||||
|
|
||||||
Document::~Document()
|
Document::~Document()
|
||||||
{
|
{
|
||||||
qDeleteAll( myViews );
|
qDeleteAll( myViews );
|
||||||
}
|
}
|
||||||
|
|
||||||
Application* Document::getApplication()
|
Application* Document::getApplication()
|
||||||
@ -73,7 +73,7 @@ void Document::createNewView( V3d_TypeOfView type )
|
|||||||
QWorkspace* ws = myApp->getWorkspace();
|
QWorkspace* ws = myApp->getWorkspace();
|
||||||
|
|
||||||
MDIWindow* w = new MDIWindow( this, ws, type );
|
MDIWindow* w = new MDIWindow( this, ws, type );
|
||||||
myViews.append( w );
|
myViews.append( w );
|
||||||
ws->addWindow( w );
|
ws->addWindow( w );
|
||||||
|
|
||||||
//connect( w, SIGNAL( message(const QString&, int) ), myApp->statusBar(), SLOT( message(const QString&, int )) );
|
//connect( w, SIGNAL( message(const QString&, int) ), myApp->statusBar(), SLOT( message(const QString&, int )) );
|
||||||
@ -86,11 +86,11 @@ void Document::createNewView( V3d_TypeOfView type )
|
|||||||
QString dir = Application::getResourceDir();
|
QString dir = Application::getResourceDir();
|
||||||
w->setWindowIcon( QPixmap( dir + tr( "ICON_DOC" ) ) );
|
w->setWindowIcon( QPixmap( dir + tr( "ICON_DOC" ) ) );
|
||||||
|
|
||||||
// show the very first window in maximized mode
|
// show the very first window in maximized mode
|
||||||
if ( ws->windowList().isEmpty() )
|
if ( ws->windowList().isEmpty() )
|
||||||
w->showMaximized();
|
w->showMaximized();
|
||||||
else
|
else
|
||||||
w->show();
|
w->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Document::createMagView( int xMin, int yMin, int xMax, int yMax )
|
void Document::createMagView( int xMin, int yMin, int xMax, int yMax )
|
||||||
|
@ -3,28 +3,28 @@
|
|||||||
#include <qmainwindow.h>
|
#include <qmainwindow.h>
|
||||||
#include <qapplication.h>
|
#include <qapplication.h>
|
||||||
#include <qtranslator.h>
|
#include <qtranslator.h>
|
||||||
#include <qpixmap.h>
|
#include <qpixmap.h>
|
||||||
#include <qtranslator.h>
|
#include <qtranslator.h>
|
||||||
|
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
|
|
||||||
#define GLOBAL_CONTEXT "@default"
|
#define GLOBAL_CONTEXT "@default"
|
||||||
|
|
||||||
class Translator : public QTranslator
|
class Translator : public QTranslator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Translator( QObject* parent = 0 ) : QTranslator( parent ) {}
|
Translator( QObject* parent = 0 ) : QTranslator( parent ) {}
|
||||||
virtual QString translate( const char* context,
|
virtual QString translate( const char* context,
|
||||||
const char* sourceText,
|
const char* sourceText,
|
||||||
const char* comment = 0 ) const
|
const char* comment = 0 ) const
|
||||||
{
|
{
|
||||||
QString res = QTranslator::translate( context, sourceText, comment );
|
QString res = QTranslator::translate( context, sourceText, comment );
|
||||||
if( res.isNull() )
|
if( res.isNull() )
|
||||||
res = QTranslator::translate( GLOBAL_CONTEXT, sourceText, comment );
|
res = QTranslator::translate( GLOBAL_CONTEXT, sourceText, comment );
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
@ -46,8 +46,8 @@ int main(int argc, char* argv[])
|
|||||||
app->setWindowIcon( pix );
|
app->setWindowIcon( pix );
|
||||||
|
|
||||||
QApplication::setOverrideCursor( Qt::WaitCursor );
|
QApplication::setOverrideCursor( Qt::WaitCursor );
|
||||||
app->show();
|
app->show();
|
||||||
app->InitApp();
|
app->InitApp();
|
||||||
QApplication::restoreOverrideCursor();
|
QApplication::restoreOverrideCursor();
|
||||||
|
|
||||||
return a.exec();
|
return a.exec();
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include <qmessagebox.h>
|
#include <qmessagebox.h>
|
||||||
#include <qaction.h>
|
#include <qaction.h>
|
||||||
#include <qsplitter.h>
|
#include <qsplitter.h>
|
||||||
#include <qmenu.h>
|
#include <qmenu.h>
|
||||||
#include <qevent.h>
|
#include <qevent.h>
|
||||||
|
|
||||||
#include "MDIWindow.h"
|
#include "MDIWindow.h"
|
||||||
@ -26,8 +26,8 @@ MDIWindow::MDIWindow( Document* aDocument, QWidget* parent, V3d_TypeOfView type
|
|||||||
myDocument = aDocument;
|
myDocument = aDocument;
|
||||||
Handle(AIS_InteractiveContext) cxt = myDocument->getContext();
|
Handle(AIS_InteractiveContext) cxt = myDocument->getContext();
|
||||||
cxt->CurrentViewer()->SetDefaultTypeOfView( type );
|
cxt->CurrentViewer()->SetDefaultTypeOfView( type );
|
||||||
myView = new View( cxt, central, this );
|
myView = new View( cxt, central, this );
|
||||||
verify(connect(myView, SIGNAL(ViewInitialized()),
|
verify(connect(myView, SIGNAL(ViewInitialized()),
|
||||||
Application::getApplication(), SLOT(updateViewDlg())));
|
Application::getApplication(), SLOT(updateViewDlg())));
|
||||||
|
|
||||||
// Graph initialization
|
// Graph initialization
|
||||||
@ -53,15 +53,15 @@ MDIWindow::MDIWindow( Document* aDocument, QWidget* parent, V3d_TypeOfView type
|
|||||||
pGraph->setYTitle(tr("LAB_SECONDS"));
|
pGraph->setYTitle(tr("LAB_SECONDS"));
|
||||||
pGraph->installEventFilter(this);
|
pGraph->installEventFilter(this);
|
||||||
pGraph->setOperationEnabled(GraphView::voRect, true);
|
pGraph->setOperationEnabled(GraphView::voRect, true);
|
||||||
pGraph->setOperationEnabled(GraphView::voZoom, true);
|
pGraph->setOperationEnabled(GraphView::voZoom, true);
|
||||||
pGraph->setOperationEnabled(GraphView::voZoomX, true);
|
pGraph->setOperationEnabled(GraphView::voZoomX, true);
|
||||||
pGraph->setOperationEnabled(GraphView::voZoomY, true);
|
pGraph->setOperationEnabled(GraphView::voZoomY, true);
|
||||||
pGraph->setOperationEnabled(GraphView::voPan, true);
|
pGraph->setOperationEnabled(GraphView::voPan, true);
|
||||||
pGraph->setOperationEnabled(GraphView::voPanX, true);
|
pGraph->setOperationEnabled(GraphView::voPanX, true);
|
||||||
pGraph->setOperationEnabled(GraphView::voPanY, true);
|
pGraph->setOperationEnabled(GraphView::voPanY, true);
|
||||||
|
|
||||||
central->setStretchFactor(0, 5);
|
central->setStretchFactor(0, 5);
|
||||||
central->setStretchFactor(1, 1);
|
central->setStretchFactor(1, 1);
|
||||||
setCentralWidget( central );
|
setCentralWidget( central );
|
||||||
|
|
||||||
myGraphPopup = new QMenu(pGraph);
|
myGraphPopup = new QMenu(pGraph);
|
||||||
@ -73,8 +73,8 @@ MDIWindow::MDIWindow( Document* aDocument, QWidget* parent, V3d_TypeOfView type
|
|||||||
verify( connect( myOperations, SIGNAL( setCursor( const QCursor& ) ),
|
verify( connect( myOperations, SIGNAL( setCursor( const QCursor& ) ),
|
||||||
SLOT( setCursor( const QCursor& ) ) ) );
|
SLOT( setCursor( const QCursor& ) ) ) );
|
||||||
|
|
||||||
createViewActions();
|
createViewActions();
|
||||||
createGraphActions();
|
createGraphActions();
|
||||||
}
|
}
|
||||||
|
|
||||||
MDIWindow::~MDIWindow()
|
MDIWindow::~MDIWindow()
|
||||||
@ -99,16 +99,16 @@ void MDIWindow::closeEvent(QCloseEvent* e)
|
|||||||
|
|
||||||
void MDIWindow::createViewActions()
|
void MDIWindow::createViewActions()
|
||||||
{
|
{
|
||||||
QToolBar* aToolBar = new QToolBar( tr( "View Operations" ), this );
|
QToolBar* aToolBar = new QToolBar( tr( "View Operations" ), this );
|
||||||
addToolBar( Qt::TopToolBarArea, aToolBar );
|
addToolBar( Qt::TopToolBarArea, aToolBar );
|
||||||
|
|
||||||
QList<QAction*> aList = myOperations->getToolActions();
|
QList<QAction*> aList = myOperations->getToolActions();
|
||||||
|
|
||||||
QActionGroup* dModeGroup = new QActionGroup( aToolBar );
|
QActionGroup* dModeGroup = new QActionGroup( aToolBar );
|
||||||
QAction* a;
|
QAction* a;
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
foreach( a, aList ) {
|
foreach( a, aList ) {
|
||||||
aToolBar->addAction( a );
|
aToolBar->addAction( a );
|
||||||
// if ( i == 1 )
|
// if ( i == 1 )
|
||||||
// aToolBar->addSeparator();
|
// aToolBar->addSeparator();
|
||||||
@ -119,7 +119,7 @@ void MDIWindow::createViewActions()
|
|||||||
}
|
}
|
||||||
aToolBar->addSeparator();
|
aToolBar->addSeparator();
|
||||||
|
|
||||||
aList = myOperations->getViewActions();
|
aList = myOperations->getViewActions();
|
||||||
foreach( a, aList ) aToolBar->addAction( a );
|
foreach( a, aList ) aToolBar->addAction( a );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,7 +168,7 @@ bool MDIWindow::eventFilter(QObject* dstObj, QEvent* event)
|
|||||||
|
|
||||||
void MDIWindow::createGraphActions()
|
void MDIWindow::createGraphActions()
|
||||||
{
|
{
|
||||||
QAction* a = new QAction( tr( "MEN_GRAPH_FIT_ALL" ), this );
|
QAction* a = new QAction( tr( "MEN_GRAPH_FIT_ALL" ), this );
|
||||||
a->setToolTip( tr( "TBR_GRAPH_FIT_ALL" ) );
|
a->setToolTip( tr( "TBR_GRAPH_FIT_ALL" ) );
|
||||||
verify( connect( a, SIGNAL( activated() ) , this, SLOT( onGraphFitAll() ) ) );
|
verify( connect( a, SIGNAL( activated() ) , this, SLOT( onGraphFitAll() ) ) );
|
||||||
myGraphPopup->addAction( a );
|
myGraphPopup->addAction( a );
|
||||||
@ -176,9 +176,9 @@ void MDIWindow::createGraphActions()
|
|||||||
myGraphPopup->addSeparator();
|
myGraphPopup->addSeparator();
|
||||||
|
|
||||||
a = new QAction( tr( "MEN_GRAPH_CLEAR" ), this );
|
a = new QAction( tr( "MEN_GRAPH_CLEAR" ), this );
|
||||||
a->setToolTip( tr( "TBR_GRAPH_CLEAR" ) );
|
a->setToolTip( tr( "TBR_GRAPH_CLEAR" ) );
|
||||||
verify( connect( a, SIGNAL( activated() ) , this, SLOT( onGraphClear() ) ) );
|
verify( connect( a, SIGNAL( activated() ) , this, SLOT( onGraphClear() ) ) );
|
||||||
myGraphPopup->addAction( a );
|
myGraphPopup->addAction( a );
|
||||||
}
|
}
|
||||||
|
|
||||||
void MDIWindow::graphPopup(const QPoint& pos)
|
void MDIWindow::graphPopup(const QPoint& pos)
|
||||||
|
@ -26,7 +26,7 @@ ObjectDlg::ObjectDlg( QWidget* parent, Handle(V3d_View)& view,
|
|||||||
Handle(AIS_InteractiveContext)& cxt )
|
Handle(AIS_InteractiveContext)& cxt )
|
||||||
: QDialog( parent ),
|
: QDialog( parent ),
|
||||||
myAutoApply( true ), myView( view ), myContext( cxt )
|
myAutoApply( true ), myView( view ), myContext( cxt )
|
||||||
{
|
{
|
||||||
setModal( false );
|
setModal( false );
|
||||||
setWindowTitle( tr( "TITLE_OBJECT_DLG" ) );
|
setWindowTitle( tr( "TITLE_OBJECT_DLG" ) );
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ ObjectDlg::ObjectDlg( QWidget* parent, Handle(V3d_View)& view,
|
|||||||
topLayout->addSpacing( 10 );
|
topLayout->addSpacing( 10 );
|
||||||
|
|
||||||
// view properties
|
// view properties
|
||||||
QGridLayout* pLayout = new QGridLayout( mainFrame );
|
QGridLayout* pLayout = new QGridLayout( mainFrame );
|
||||||
pLayout->setMargin( 5 );
|
pLayout->setMargin( 5 );
|
||||||
myDegModelLabel = new QLabel( tr("MEN_DLG_DEGMODEL"), mainFrame );
|
myDegModelLabel = new QLabel( tr("MEN_DLG_DEGMODEL"), mainFrame );
|
||||||
myDegRatioLabel = new QLabel( tr("MEN_DLG_DEGRATIO"), mainFrame );
|
myDegRatioLabel = new QLabel( tr("MEN_DLG_DEGRATIO"), mainFrame );
|
||||||
@ -56,8 +56,8 @@ ObjectDlg::ObjectDlg( QWidget* parent, Handle(V3d_View)& view,
|
|||||||
|
|
||||||
//QSpinBox* degRatioSpin = new QSpinBox( mainFrame );
|
//QSpinBox* degRatioSpin = new QSpinBox( mainFrame );
|
||||||
//QSpinBox ( QWidget * parent = 0, const char * name = 0 )
|
//QSpinBox ( QWidget * parent = 0, const char * name = 0 )
|
||||||
myDegRatioSpin = new QSpinBox( mainFrame );
|
myDegRatioSpin = new QSpinBox( mainFrame );
|
||||||
myDegRatioSpin->setRange(0, 10);
|
myDegRatioSpin->setRange(0, 10);
|
||||||
myDegRatioSpin->setSingleStep(1);
|
myDegRatioSpin->setSingleStep(1);
|
||||||
verify( connect( myDegRatioSpin, SIGNAL( valueChanged( int ) ), SLOT( onDegRatio( int ) ) ) );
|
verify( connect( myDegRatioSpin, SIGNAL( valueChanged( int ) ), SLOT( onDegRatio( int ) ) ) );
|
||||||
|
|
||||||
@ -77,8 +77,8 @@ ObjectDlg::ObjectDlg( QWidget* parent, Handle(V3d_View)& view,
|
|||||||
verify( connect( myEdgeBox, SIGNAL( activated( int ) ), SLOT( onEdgeStyle( int ) ) ) );
|
verify( connect( myEdgeBox, SIGNAL( activated( int ) ), SLOT( onEdgeStyle( int ) ) ) );
|
||||||
|
|
||||||
//myEdgeSpin = new QSpinBox( mainFrame );
|
//myEdgeSpin = new QSpinBox( mainFrame );
|
||||||
myEdgeSpin = new QSpinBox( mainFrame );
|
myEdgeSpin = new QSpinBox( mainFrame );
|
||||||
myEdgeSpin->setRange(1, 10);
|
myEdgeSpin->setRange(1, 10);
|
||||||
myEdgeSpin->setSingleStep(10);
|
myEdgeSpin->setSingleStep(10);
|
||||||
verify( connect( myEdgeSpin, SIGNAL( valueChanged( int ) ), SLOT( onEdgeWidth( int ) ) ) );
|
verify( connect( myEdgeSpin, SIGNAL( valueChanged( int ) ), SLOT( onEdgeWidth( int ) ) ) );
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ ObjectDlg::ObjectDlg( QWidget* parent, Handle(V3d_View)& view,
|
|||||||
|
|
||||||
QHBoxLayout* applyLayout = new QHBoxLayout();
|
QHBoxLayout* applyLayout = new QHBoxLayout();
|
||||||
applyLayout->addWidget( autoApply );
|
applyLayout->addWidget( autoApply );
|
||||||
applyLayout->addStretch( 10 );
|
applyLayout->addStretch( 10 );
|
||||||
topLayout->addLayout(applyLayout);
|
topLayout->addLayout(applyLayout);
|
||||||
topLayout->addSpacing( 10 );
|
topLayout->addSpacing( 10 );
|
||||||
|
|
||||||
@ -115,17 +115,17 @@ ObjectDlg::ObjectDlg( QWidget* parent, Handle(V3d_View)& view,
|
|||||||
verify( connect( bOk, SIGNAL( clicked() ), SLOT( onOk() ) ) );
|
verify( connect( bOk, SIGNAL( clicked() ), SLOT( onOk() ) ) );
|
||||||
bCancel = new QPushButton( tr( "BTN_CANCEL" ), this );
|
bCancel = new QPushButton( tr( "BTN_CANCEL" ), this );
|
||||||
verify( connect( bCancel, SIGNAL( clicked() ), SLOT( onCancel() ) ) );
|
verify( connect( bCancel, SIGNAL( clicked() ), SLOT( onCancel() ) ) );
|
||||||
// bHelp = new QPushButton( tr( "BTN_HELP" ), this );
|
// bHelp = new QPushButton( tr( "BTN_HELP" ), this );
|
||||||
// verify( connect( bHelp, SIGNAL( clicked() ), SLOT( onHelp() ) ) );
|
// verify( connect( bHelp, SIGNAL( clicked() ), SLOT( onHelp() ) ) );
|
||||||
|
|
||||||
QHBoxLayout* btnLayout = new QHBoxLayout();
|
QHBoxLayout* btnLayout = new QHBoxLayout();
|
||||||
btnLayout->setSpacing( 5 );
|
btnLayout->setSpacing( 5 );
|
||||||
btnLayout->addStretch( 10 );
|
btnLayout->addStretch( 10 );
|
||||||
btnLayout->addWidget( bOk );
|
btnLayout->addWidget( bOk );
|
||||||
btnLayout->addWidget( bCancel );
|
btnLayout->addWidget( bCancel );
|
||||||
btnLayout->addStretch( 10 );
|
btnLayout->addStretch( 10 );
|
||||||
// btnLayout->addWidget( bHelp );
|
// btnLayout->addWidget( bHelp );
|
||||||
topLayout->addLayout(btnLayout);
|
topLayout->addLayout(btnLayout);
|
||||||
|
|
||||||
QSize s = topLayout->totalMinimumSize();
|
QSize s = topLayout->totalMinimumSize();
|
||||||
s.setWidth( s.width() + topLayout->margin() + 10 );
|
s.setWidth( s.width() + topLayout->margin() + 10 );
|
||||||
@ -241,38 +241,38 @@ void ObjectDlg::onAutoApply( bool on )
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ObjectDlg::updateEdgeAspect( bool edgeStyle )
|
void ObjectDlg::updateEdgeAspect( bool edgeStyle )
|
||||||
{
|
{
|
||||||
Aspect_TypeOfLine type;
|
Aspect_TypeOfLine type;
|
||||||
if ( edgeStyle )
|
if ( edgeStyle )
|
||||||
switch( myCurrentEdgeStyle ) {
|
switch( myCurrentEdgeStyle ) {
|
||||||
case SolidEdgeId :
|
case SolidEdgeId :
|
||||||
type = Aspect_TOL_SOLID;
|
type = Aspect_TOL_SOLID;
|
||||||
break;
|
break;
|
||||||
case DashEdgeId :
|
case DashEdgeId :
|
||||||
type = Aspect_TOL_DASH;
|
type = Aspect_TOL_DASH;
|
||||||
break;
|
break;
|
||||||
case DotEdgeId :
|
case DotEdgeId :
|
||||||
type = Aspect_TOL_DOT;
|
type = Aspect_TOL_DOT;
|
||||||
break;
|
break;
|
||||||
case DotDashEdgeId :
|
case DotDashEdgeId :
|
||||||
type = Aspect_TOL_DOTDASH;
|
type = Aspect_TOL_DOTDASH;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Handle(AIS_InteractiveObject) object;
|
Handle(AIS_InteractiveObject) object;
|
||||||
Handle(Prs3d_ShadingAspect) aspect;
|
Handle(Prs3d_ShadingAspect) aspect;
|
||||||
myContext->InitSelected();
|
myContext->InitSelected();
|
||||||
for( ; myContext->MoreSelected(); myContext->NextSelected() ) {
|
for( ; myContext->MoreSelected(); myContext->NextSelected() ) {
|
||||||
object = myContext->SelectedInteractive();
|
object = myContext->SelectedInteractive();
|
||||||
aspect = object->Attributes()->ShadingAspect();
|
aspect = object->Attributes()->ShadingAspect();
|
||||||
if ( edgeStyle )
|
if ( edgeStyle )
|
||||||
aspect->Aspect()->SetEdgeLineType( type );
|
aspect->Aspect()->SetEdgeLineType( type );
|
||||||
else
|
else
|
||||||
aspect->Aspect()->SetEdgeWidth( myCurrentEdgeWidth );
|
aspect->Aspect()->SetEdgeWidth( myCurrentEdgeWidth );
|
||||||
object->SetAspect( aspect );
|
object->SetAspect( aspect );
|
||||||
}
|
}
|
||||||
if ( myAutoApply )
|
if ( myAutoApply )
|
||||||
//myContext->UpdateCurrentViewer();
|
//myContext->UpdateCurrentViewer();
|
||||||
myView->Viewer()->Update();
|
myView->Viewer()->Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectDlg::updateDegenerationModel()
|
void ObjectDlg::updateDegenerationModel()
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
#include <Prs3d_ShadingAspect.hxx>
|
#include <Prs3d_ShadingAspect.hxx>
|
||||||
#include <AIS_InteractiveObject.hxx>
|
#include <AIS_InteractiveObject.hxx>
|
||||||
#include <AIS_Drawer.hxx>
|
#include <AIS_Drawer.hxx>
|
||||||
#include <Graphic3d_ArrayOfPrimitives.hxx>
|
#include <Graphic3d_ArrayOfPrimitives.hxx>
|
||||||
|
|
||||||
#include <Sphere_Sphere.hxx>
|
#include <Sphere_Sphere.hxx>
|
||||||
#include <gp_Pnt.hxx>
|
#include <gp_Pnt.hxx>
|
||||||
@ -34,7 +34,7 @@ ShapeDlg::ShapeDlg( QWidget* parent, Handle(V3d_View)& view,
|
|||||||
Handle(AIS_InteractiveContext)& cxt )
|
Handle(AIS_InteractiveContext)& cxt )
|
||||||
: QDialog( parent ),
|
: QDialog( parent ),
|
||||||
myView( view ), myContext( cxt )
|
myView( view ), myContext( cxt )
|
||||||
{
|
{
|
||||||
setModal( false );
|
setModal( false );
|
||||||
setWindowTitle( tr( "TITLE_SHAPE_DLG" ) );
|
setWindowTitle( tr( "TITLE_SHAPE_DLG" ) );
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ ShapeDlg::ShapeDlg( QWidget* parent, Handle(V3d_View)& view,
|
|||||||
myNbPanes = 0;
|
myNbPanes = 0;
|
||||||
myNbItems = 0;
|
myNbItems = 0;
|
||||||
|
|
||||||
QVBoxLayout* topLayout = new QVBoxLayout( this );
|
QVBoxLayout* topLayout = new QVBoxLayout( this );
|
||||||
topLayout->setMargin( 5 );
|
topLayout->setMargin( 5 );
|
||||||
|
|
||||||
// radius frame
|
// radius frame
|
||||||
@ -53,15 +53,15 @@ ShapeDlg::ShapeDlg( QWidget* parent, Handle(V3d_View)& view,
|
|||||||
topLayout->addSpacing( 10 );
|
topLayout->addSpacing( 10 );
|
||||||
|
|
||||||
QHBoxLayout* rBox = new QHBoxLayout( rFrame );
|
QHBoxLayout* rBox = new QHBoxLayout( rFrame );
|
||||||
rBox->setMargin( 5 );
|
rBox->setMargin( 5 );
|
||||||
QLabel* rad = new QLabel( tr( "MEN_DLG_RADIUS" ), rFrame );
|
QLabel* rad = new QLabel( tr( "MEN_DLG_RADIUS" ), rFrame );
|
||||||
QDoubleSpinBox* rSpin = new QDoubleSpinBox( rFrame );
|
QDoubleSpinBox* rSpin = new QDoubleSpinBox( rFrame );
|
||||||
rSpin->setRange( 1, 10000 );
|
rSpin->setRange( 1, 10000 );
|
||||||
rSpin->setSingleStep( 1 );
|
rSpin->setSingleStep( 1 );
|
||||||
// rSpin->setValueDouble( myRadius );
|
// rSpin->setValueDouble( myRadius );
|
||||||
rSpin->setValue( myRadius );
|
rSpin->setValue( myRadius );
|
||||||
// verify( connect( rSpin, SIGNAL( sbdValueChanged( double ) ), SLOT( onRadiusChanged( double ) ) ) );
|
// verify( connect( rSpin, SIGNAL( sbdValueChanged( double ) ), SLOT( onRadiusChanged( double ) ) ) );
|
||||||
verify( connect( rSpin, SIGNAL( valueChanged( double ) ), SLOT( onRadiusChanged( double ) ) ) );
|
verify( connect( rSpin, SIGNAL( valueChanged( double ) ), SLOT( onRadiusChanged( double ) ) ) );
|
||||||
|
|
||||||
rBox->addWidget( rad );
|
rBox->addWidget( rad );
|
||||||
rBox->addWidget( rSpin );
|
rBox->addWidget( rSpin );
|
||||||
@ -70,7 +70,7 @@ ShapeDlg::ShapeDlg( QWidget* parent, Handle(V3d_View)& view,
|
|||||||
// sphere position frame
|
// sphere position frame
|
||||||
QFrame* pFrame = new QFrame( this );
|
QFrame* pFrame = new QFrame( this );
|
||||||
QHBoxLayout* pBox = new QHBoxLayout( pFrame );
|
QHBoxLayout* pBox = new QHBoxLayout( pFrame );
|
||||||
pBox->setMargin( 5 );
|
pBox->setMargin( 5 );
|
||||||
|
|
||||||
pFrame->setFrameStyle( QFrame::Box | QFrame::Sunken );
|
pFrame->setFrameStyle( QFrame::Box | QFrame::Sunken );
|
||||||
topLayout->addWidget( pFrame );
|
topLayout->addWidget( pFrame );
|
||||||
@ -82,22 +82,22 @@ ShapeDlg::ShapeDlg( QWidget* parent, Handle(V3d_View)& view,
|
|||||||
lY = new QLabel( tr( "MEN_DLG_Y" ), pFrame );
|
lY = new QLabel( tr( "MEN_DLG_Y" ), pFrame );
|
||||||
lZ = new QLabel( tr( "MEN_DLG_Z" ), pFrame );
|
lZ = new QLabel( tr( "MEN_DLG_Z" ), pFrame );
|
||||||
|
|
||||||
myXSpin = new QDoubleSpinBox( pFrame );
|
myXSpin = new QDoubleSpinBox( pFrame );
|
||||||
myXSpin->setRange( -10000, 10000 );
|
myXSpin->setRange( -10000, 10000 );
|
||||||
myXSpin->setSingleStep( 1 );
|
myXSpin->setSingleStep( 1 );
|
||||||
myXSpin->setValue( 0 );
|
myXSpin->setValue( 0 );
|
||||||
connect(myXSpin, SIGNAL(valueChanged (double)), SLOT(onPositionChanged()));
|
connect(myXSpin, SIGNAL(valueChanged (double)), SLOT(onPositionChanged()));
|
||||||
myYSpin = new QDoubleSpinBox( pFrame );
|
myYSpin = new QDoubleSpinBox( pFrame );
|
||||||
myYSpin->setRange( -10000, 10000 );
|
myYSpin->setRange( -10000, 10000 );
|
||||||
myYSpin->setSingleStep( 1 );
|
myYSpin->setSingleStep( 1 );
|
||||||
myYSpin->setValue( 0 );
|
myYSpin->setValue( 0 );
|
||||||
connect(myYSpin, SIGNAL(valueChanged (double)), SLOT(onPositionChanged()));
|
connect(myYSpin, SIGNAL(valueChanged (double)), SLOT(onPositionChanged()));
|
||||||
myZSpin = new QDoubleSpinBox( pFrame );
|
myZSpin = new QDoubleSpinBox( pFrame );
|
||||||
myZSpin->setRange( -10000, 10000 );
|
myZSpin->setRange( -10000, 10000 );
|
||||||
myZSpin->setSingleStep( 1 );
|
myZSpin->setSingleStep( 1 );
|
||||||
myZSpin->setValue( 0 );
|
myZSpin->setValue( 0 );
|
||||||
connect(myZSpin, SIGNAL(valueChanged (double)), SLOT(onPositionChanged()));
|
connect(myZSpin, SIGNAL(valueChanged (double)), SLOT(onPositionChanged()));
|
||||||
|
|
||||||
|
|
||||||
pBox->addStretch( 2 );
|
pBox->addStretch( 2 );
|
||||||
pBox->addWidget( lX );
|
pBox->addWidget( lX );
|
||||||
@ -113,7 +113,7 @@ ShapeDlg::ShapeDlg( QWidget* parent, Handle(V3d_View)& view,
|
|||||||
// sphere aspect frame
|
// sphere aspect frame
|
||||||
QFrame* aFrame = new QFrame( this );
|
QFrame* aFrame = new QFrame( this );
|
||||||
QHBoxLayout* aBox = new QHBoxLayout( aFrame );
|
QHBoxLayout* aBox = new QHBoxLayout( aFrame );
|
||||||
aBox->setMargin( 5 );
|
aBox->setMargin( 5 );
|
||||||
|
|
||||||
aFrame->setFrameStyle( QFrame::Box | QFrame::Sunken );
|
aFrame->setFrameStyle( QFrame::Box | QFrame::Sunken );
|
||||||
topLayout->addWidget( aFrame );
|
topLayout->addWidget( aFrame );
|
||||||
@ -132,10 +132,10 @@ ShapeDlg::ShapeDlg( QWidget* parent, Handle(V3d_View)& view,
|
|||||||
myVTexel->setText( tr( "MEN_BTN_VTEXEL" ) );
|
myVTexel->setText( tr( "MEN_BTN_VTEXEL" ) );
|
||||||
//verify( connect( myVTexel, SIGNAL( toggled( bool ) ), SLOT( onShowEdges( bool ) ) ) );
|
//verify( connect( myVTexel, SIGNAL( toggled( bool ) ), SLOT( onShowEdges( bool ) ) ) );
|
||||||
|
|
||||||
myText = new QCheckBox( aFrame );
|
myText = new QCheckBox( aFrame );
|
||||||
myText->setText( tr( "MEN_BTN_TEXT" ) );
|
myText->setText( tr( "MEN_BTN_TEXT" ) );
|
||||||
verify( connect( myText, SIGNAL( clicked() ), SLOT( onText() ) ) );
|
verify( connect( myText, SIGNAL( clicked() ), SLOT( onText() ) ) );
|
||||||
|
|
||||||
aBox->addStretch( 2 );
|
aBox->addStretch( 2 );
|
||||||
aBox->addWidget( myVNormal );
|
aBox->addWidget( myVNormal );
|
||||||
aBox->addStretch( 2 );
|
aBox->addStretch( 2 );
|
||||||
@ -143,13 +143,13 @@ ShapeDlg::ShapeDlg( QWidget* parent, Handle(V3d_View)& view,
|
|||||||
aBox->addStretch( 2 );
|
aBox->addStretch( 2 );
|
||||||
aBox->addWidget( myVTexel );
|
aBox->addWidget( myVTexel );
|
||||||
aBox->addStretch( 2 );
|
aBox->addStretch( 2 );
|
||||||
aBox->addWidget( myText );
|
aBox->addWidget( myText );
|
||||||
aBox->addStretch( 2 );
|
aBox->addStretch( 2 );
|
||||||
|
|
||||||
// tesselation frame
|
// tesselation frame
|
||||||
QFrame* tFrame = new QFrame( this );
|
QFrame* tFrame = new QFrame( this );
|
||||||
QHBoxLayout* tBox = new QHBoxLayout( tFrame );
|
QHBoxLayout* tBox = new QHBoxLayout( tFrame );
|
||||||
tBox->setMargin( 5 );
|
tBox->setMargin( 5 );
|
||||||
|
|
||||||
tFrame->setFrameStyle( QFrame::Box | QFrame::Sunken );
|
tFrame->setFrameStyle( QFrame::Box | QFrame::Sunken );
|
||||||
topLayout->addWidget( tFrame );
|
topLayout->addWidget( tFrame );
|
||||||
@ -161,18 +161,18 @@ ShapeDlg::ShapeDlg( QWidget* parent, Handle(V3d_View)& view,
|
|||||||
panes = new QLabel( tr( "MEN_DLG_PANES" ), tFrame );
|
panes = new QLabel( tr( "MEN_DLG_PANES" ), tFrame );
|
||||||
items = new QLabel( tr( "MEN_DLG_ITEMS" ), tFrame );
|
items = new QLabel( tr( "MEN_DLG_ITEMS" ), tFrame );
|
||||||
|
|
||||||
myDefSpin = new QDoubleSpinBox( tFrame );
|
myDefSpin = new QDoubleSpinBox( tFrame );
|
||||||
myDefSpin->setRange( 0.1, 13 );
|
myDefSpin->setRange( 0.1, 13 );
|
||||||
myDefSpin->setSingleStep( 0.1 );
|
myDefSpin->setSingleStep( 0.1 );
|
||||||
myDefSpin->setValue( 1 );
|
myDefSpin->setValue( 1 );
|
||||||
verify( connect( myDefSpin, SIGNAL( valueChanged( double ) ), SLOT( onDeflectionChanged( double ) ) ) );
|
verify( connect( myDefSpin, SIGNAL( valueChanged( double ) ), SLOT( onDeflectionChanged( double ) ) ) );
|
||||||
myPanesSpin = new QSpinBox( tFrame );
|
myPanesSpin = new QSpinBox( tFrame );
|
||||||
myPanesSpin->setRange( 8, 10000 );
|
myPanesSpin->setRange( 8, 10000 );
|
||||||
myPanesSpin->setSingleStep( 1 );
|
myPanesSpin->setSingleStep( 1 );
|
||||||
verify( connect( myPanesSpin, SIGNAL( valueChanged( int ) ), SLOT( onPanesChanged( int ) ) ) );
|
verify( connect( myPanesSpin, SIGNAL( valueChanged( int ) ), SLOT( onPanesChanged( int ) ) ) );
|
||||||
myItemsSpin = new QSpinBox( tFrame );
|
myItemsSpin = new QSpinBox( tFrame );
|
||||||
myItemsSpin->setRange( 25, 10000000 );
|
myItemsSpin->setRange( 25, 10000000 );
|
||||||
myItemsSpin->setSingleStep( 1 );
|
myItemsSpin->setSingleStep( 1 );
|
||||||
verify( connect( myItemsSpin, SIGNAL( valueChanged( int ) ), SLOT( onItemsChanged( int ) ) ) );
|
verify( connect( myItemsSpin, SIGNAL( valueChanged( int ) ), SLOT( onItemsChanged( int ) ) ) );
|
||||||
|
|
||||||
tBox->addWidget( defl );
|
tBox->addWidget( defl );
|
||||||
@ -188,19 +188,19 @@ ShapeDlg::ShapeDlg( QWidget* parent, Handle(V3d_View)& view,
|
|||||||
bOk->setDefault(true);
|
bOk->setDefault(true);
|
||||||
verify( connect( bOk, SIGNAL( clicked() ), SLOT( onOk() ) ) );
|
verify( connect( bOk, SIGNAL( clicked() ), SLOT( onOk() ) ) );
|
||||||
bCancel = new QPushButton( tr( "BTN_CANCEL" ), this );
|
bCancel = new QPushButton( tr( "BTN_CANCEL" ), this );
|
||||||
verify( connect( bCancel, SIGNAL( clicked() ), SLOT( onCancel() ) ) );
|
verify( connect( bCancel, SIGNAL( clicked() ), SLOT( onCancel() ) ) );
|
||||||
verify( connect( this, SIGNAL( destroyed() ), SLOT( onCancel() ) ) );
|
verify( connect( this, SIGNAL( destroyed() ), SLOT( onCancel() ) ) );
|
||||||
// bHelp = new QPushButton( tr( "BTN_HELP" ), this );
|
// bHelp = new QPushButton( tr( "BTN_HELP" ), this );
|
||||||
// verify( connect( bHelp, SIGNAL( clicked() ), SLOT( onHelp() ) ) );
|
// verify( connect( bHelp, SIGNAL( clicked() ), SLOT( onHelp() ) ) );
|
||||||
|
|
||||||
QHBoxLayout* btnLayout = new QHBoxLayout();
|
QHBoxLayout* btnLayout = new QHBoxLayout();
|
||||||
btnLayout->setSpacing( 5 );
|
btnLayout->setSpacing( 5 );
|
||||||
btnLayout->addStretch( 10 );
|
btnLayout->addStretch( 10 );
|
||||||
btnLayout->addWidget( bOk );
|
btnLayout->addWidget( bOk );
|
||||||
btnLayout->addWidget( bCancel );
|
btnLayout->addWidget( bCancel );
|
||||||
btnLayout->addStretch( 10 );
|
btnLayout->addStretch( 10 );
|
||||||
// btnLayout->addWidget( bHelp );
|
// btnLayout->addWidget( bHelp );
|
||||||
topLayout->addLayout( btnLayout );
|
topLayout->addLayout( btnLayout );
|
||||||
|
|
||||||
QSize s = topLayout->totalMinimumSize();
|
QSize s = topLayout->totalMinimumSize();
|
||||||
s.setWidth( s.width() + topLayout->margin() + 10 );
|
s.setWidth( s.width() + topLayout->margin() + 10 );
|
||||||
@ -218,9 +218,9 @@ void ShapeDlg::showEvent ( QShowEvent* e )
|
|||||||
// myXSpin->setValueDouble( 0 );
|
// myXSpin->setValueDouble( 0 );
|
||||||
// myYSpin->setValueDouble( 0 );
|
// myYSpin->setValueDouble( 0 );
|
||||||
// myZSpin->setValueDouble( 0 );
|
// myZSpin->setValueDouble( 0 );
|
||||||
myXSpin->setValue( 0 );
|
myXSpin->setValue( 0 );
|
||||||
myYSpin->setValue( 0 );
|
myYSpin->setValue( 0 );
|
||||||
myZSpin->setValue( 0 );
|
myZSpin->setValue( 0 );
|
||||||
onRadiusChanged( myRadius );
|
onRadiusChanged( myRadius );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -257,7 +257,7 @@ void ShapeDlg::onRadiusChanged( double value )
|
|||||||
|
|
||||||
myPanesSpin->blockSignals( false );
|
myPanesSpin->blockSignals( false );
|
||||||
myItemsSpin->blockSignals( false );
|
myItemsSpin->blockSignals( false );
|
||||||
|
|
||||||
updateSphere();
|
updateSphere();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -271,7 +271,7 @@ void ShapeDlg::onItemsChanged( int value )
|
|||||||
myPanesSpin->blockSignals( true );
|
myPanesSpin->blockSignals( true );
|
||||||
|
|
||||||
// myDefSpin->setValueDouble( myDeflection );
|
// myDefSpin->setValueDouble( myDeflection );
|
||||||
myDefSpin->setValue( myDeflection );
|
myDefSpin->setValue( myDeflection );
|
||||||
myPanesSpin->setValue( myNbPanes );
|
myPanesSpin->setValue( myNbPanes );
|
||||||
|
|
||||||
myDefSpin->blockSignals( false );
|
myDefSpin->blockSignals( false );
|
||||||
@ -290,7 +290,7 @@ void ShapeDlg::onPanesChanged( int value )
|
|||||||
myItemsSpin->blockSignals( true );
|
myItemsSpin->blockSignals( true );
|
||||||
|
|
||||||
// myDefSpin->setValueDouble( myDeflection );
|
// myDefSpin->setValueDouble( myDeflection );
|
||||||
myDefSpin->setValue( myDeflection );
|
myDefSpin->setValue( myDeflection );
|
||||||
myItemsSpin->setValue( myNbItems );
|
myItemsSpin->setValue( myNbItems );
|
||||||
|
|
||||||
myDefSpin->blockSignals( false );
|
myDefSpin->blockSignals( false );
|
||||||
@ -316,12 +316,12 @@ void ShapeDlg::onDeflectionChanged( double value )
|
|||||||
|
|
||||||
updateSphere();
|
updateSphere();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShapeDlg::onText()
|
void ShapeDlg::onText()
|
||||||
{
|
{
|
||||||
updateSphere();
|
updateSphere();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ShapeDlg::updateSphere()
|
void ShapeDlg::updateSphere()
|
||||||
{
|
{
|
||||||
@ -345,13 +345,13 @@ void ShapeDlg::updateSphere()
|
|||||||
Application::stopTimer( 0, "UPDATE", !visible );
|
Application::stopTimer( 0, "UPDATE", !visible );
|
||||||
QApplication::restoreOverrideCursor();
|
QApplication::restoreOverrideCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShapeDlg::onPositionChanged()
|
void ShapeDlg::onPositionChanged()
|
||||||
{
|
{
|
||||||
updateSphere();
|
updateSphere();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShapeDlg::closeEvent ( QCloseEvent* e )
|
void ShapeDlg::closeEvent ( QCloseEvent* e )
|
||||||
{
|
{
|
||||||
onCancel();
|
onCancel();
|
||||||
}
|
}
|
||||||
|
@ -32,17 +32,17 @@
|
|||||||
#include <gp_Pnt2d.hxx>
|
#include <gp_Pnt2d.hxx>
|
||||||
#include <gp_Vec.hxx>
|
#include <gp_Vec.hxx>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <Graphic3d_AspectText3d.hxx>
|
#include <Graphic3d_AspectText3d.hxx>
|
||||||
|
|
||||||
Standard_CString stText="Test";
|
Standard_CString stText="Test";
|
||||||
Standard_Integer stTextHeight=10;
|
Standard_Integer stTextHeight=10;
|
||||||
|
|
||||||
static void ShadeWithVertex(const Handle(Graphic3d_Group) aGroup,
|
static void ShadeWithVertex(const Handle(Graphic3d_Group) aGroup,
|
||||||
const gp_Pnt aPosition,
|
const gp_Pnt aPosition,
|
||||||
const Standard_Real aRadius,
|
const Standard_Real aRadius,
|
||||||
const Standard_Real aDeflection,
|
const Standard_Real aDeflection,
|
||||||
const Standard_Boolean isText,
|
const Standard_Boolean isText,
|
||||||
const Standard_Boolean isOptText)
|
const Standard_Boolean isOptText)
|
||||||
{
|
{
|
||||||
Standard_Real R1,R2;
|
Standard_Real R1,R2;
|
||||||
@ -58,12 +58,12 @@ static void ShadeWithVertex(const Handle(Graphic3d_Group) aGroup,
|
|||||||
Standard_Real Dalpha = 2.*Standard_PI/nbpanes;
|
Standard_Real Dalpha = 2.*Standard_PI/nbpanes;
|
||||||
Standard_Integer i,j;
|
Standard_Integer i,j;
|
||||||
|
|
||||||
aPosition.Coord (Xc, Yc, Zc);
|
aPosition.Coord (Xc, Yc, Zc);
|
||||||
if(isText) {
|
if(isText) {
|
||||||
Handle(Graphic3d_AspectText3d) Text3d = new Graphic3d_AspectText3d();
|
Handle(Graphic3d_AspectText3d) Text3d = new Graphic3d_AspectText3d();
|
||||||
Text3d->SetTextureMappedFont(isOptText);
|
Text3d->SetTextureMappedFont(isOptText);
|
||||||
aGroup->SetPrimitivesAspect(Text3d);
|
aGroup->SetPrimitivesAspect(Text3d);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef G005
|
#ifdef G005
|
||||||
if( Graphic3d_ArrayOfPrimitives::IsEnable() ) {
|
if( Graphic3d_ArrayOfPrimitives::IsEnable() ) {
|
||||||
@ -72,8 +72,8 @@ static void ShadeWithVertex(const Handle(Graphic3d_Group) aGroup,
|
|||||||
Standard_False,Standard_False,Standard_False,Standard_False);
|
Standard_False,Standard_False,Standard_False,Standard_False);
|
||||||
Handle(Graphic3d_ArrayOfQuadrangles) pquad =
|
Handle(Graphic3d_ArrayOfQuadrangles) pquad =
|
||||||
new Graphic3d_ArrayOfQuadrangles(4*nbpanes*(nbpanes/2-2),0,
|
new Graphic3d_ArrayOfQuadrangles(4*nbpanes*(nbpanes/2-2),0,
|
||||||
Standard_False,Standard_False,Standard_False,Standard_False);
|
Standard_False,Standard_False,Standard_False,Standard_False);
|
||||||
aGroup->BeginPrimitives();
|
aGroup->BeginPrimitives();
|
||||||
for( j=0; j<nbpanes/2; j++ ) {
|
for( j=0; j<nbpanes/2; j++ ) {
|
||||||
Alpha = 0.;
|
Alpha = 0.;
|
||||||
R1 = aRadius*sin(Beta);
|
R1 = aRadius*sin(Beta);
|
||||||
@ -92,27 +92,27 @@ static void ShadeWithVertex(const Handle(Graphic3d_Group) aGroup,
|
|||||||
X4 = R1*cos(Alpha);
|
X4 = R1*cos(Alpha);
|
||||||
Y4 = R1*sin(Alpha);
|
Y4 = R1*sin(Alpha);
|
||||||
if( j == 0 ) {
|
if( j == 0 ) {
|
||||||
ptri->AddVertex(X1+Xc,Y1+Yc,Z1+Zc);
|
ptri->AddVertex(X1+Xc,Y1+Yc,Z1+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
||||||
ptri->AddVertex(X2+Xc,Y2+Yc,Z2+Zc);
|
ptri->AddVertex(X2+Xc,Y2+Yc,Z2+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
||||||
ptri->AddVertex(X3+Xc,Y3+Yc,Z3+Zc);
|
ptri->AddVertex(X3+Xc,Y3+Yc,Z3+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
||||||
} else if( j == nbpanes/2-1 ) {
|
} else if( j == nbpanes/2-1 ) {
|
||||||
ptri->AddVertex(X1+Xc,Y1+Yc,Z1+Zc);
|
ptri->AddVertex(X1+Xc,Y1+Yc,Z1+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
||||||
ptri->AddVertex(X2+Xc,Y2+Yc,Z2+Zc);
|
ptri->AddVertex(X2+Xc,Y2+Yc,Z2+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
||||||
ptri->AddVertex(X4+Xc,Y4+Yc,Z4+Zc);
|
ptri->AddVertex(X4+Xc,Y4+Yc,Z4+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
||||||
} else {
|
} else {
|
||||||
pquad->AddVertex(X1+Xc,Y1+Yc,Z1+Zc);
|
pquad->AddVertex(X1+Xc,Y1+Yc,Z1+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
||||||
pquad->AddVertex(X2+Xc,Y2+Yc,Z2+Zc);
|
pquad->AddVertex(X2+Xc,Y2+Yc,Z2+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
||||||
pquad->AddVertex(X3+Xc,Y3+Yc,Z3+Zc);
|
pquad->AddVertex(X3+Xc,Y3+Yc,Z3+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
||||||
pquad->AddVertex(X4+Xc,Y4+Yc,Z4+Zc);
|
pquad->AddVertex(X4+Xc,Y4+Yc,Z4+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -124,7 +124,7 @@ static void ShadeWithVertex(const Handle(Graphic3d_Group) aGroup,
|
|||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
aGroup->BeginPrimitives();
|
aGroup->BeginPrimitives();
|
||||||
Graphic3d_Array1OfVertex TriVertex(1,3*nbpanes*2);
|
Graphic3d_Array1OfVertex TriVertex(1,3*nbpanes*2);
|
||||||
Graphic3d_Array1OfVertex QuadVertex(1,4*nbpanes*(nbpanes/2-2));
|
Graphic3d_Array1OfVertex QuadVertex(1,4*nbpanes*(nbpanes/2-2));
|
||||||
Aspect_Array1OfEdge TriEdge(1,3*nbpanes*2);
|
Aspect_Array1OfEdge TriEdge(1,3*nbpanes*2);
|
||||||
@ -149,45 +149,45 @@ static void ShadeWithVertex(const Handle(Graphic3d_Group) aGroup,
|
|||||||
Y4 = R1*sin(Alpha);
|
Y4 = R1*sin(Alpha);
|
||||||
if( j == 0 ) {
|
if( j == 0 ) {
|
||||||
nt++;
|
nt++;
|
||||||
TriVertex(nt).SetCoord(X1+Xc,Y1+Yc,Z1+Zc);
|
TriVertex(nt).SetCoord(X1+Xc,Y1+Yc,Z1+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
||||||
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
||||||
nt++;
|
nt++;
|
||||||
TriVertex(nt).SetCoord(X2+Xc,Y2+Yc,Z2+Zc);
|
TriVertex(nt).SetCoord(X2+Xc,Y2+Yc,Z2+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
||||||
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
||||||
nt++;
|
nt++;
|
||||||
TriVertex(nt).SetCoord(X3+Xc,Y3+Yc,Z3+Zc);
|
TriVertex(nt).SetCoord(X3+Xc,Y3+Yc,Z3+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
||||||
TriEdge(nt).SetValues(nt,nt-2,Aspect_TOE_VISIBLE);
|
TriEdge(nt).SetValues(nt,nt-2,Aspect_TOE_VISIBLE);
|
||||||
} else if( j == nbpanes/2-1 ) {
|
} else if( j == nbpanes/2-1 ) {
|
||||||
nt++;
|
nt++;
|
||||||
TriVertex(nt).SetCoord(X1+Xc,Y1+Yc,Z1+Zc);
|
TriVertex(nt).SetCoord(X1+Xc,Y1+Yc,Z1+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
||||||
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
||||||
nt++;
|
nt++;
|
||||||
TriVertex(nt).SetCoord(X2+Xc,Y2+Yc,Z2+Zc);
|
TriVertex(nt).SetCoord(X2+Xc,Y2+Yc,Z2+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
||||||
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
||||||
nt++;
|
nt++;
|
||||||
TriVertex(nt).SetCoord(X4+Xc,Y4+Yc,Z4+Zc);
|
TriVertex(nt).SetCoord(X4+Xc,Y4+Yc,Z4+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
||||||
TriEdge(nt).SetValues(nt,nt-2,Aspect_TOE_VISIBLE);
|
TriEdge(nt).SetValues(nt,nt-2,Aspect_TOE_VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
nq++;
|
nq++;
|
||||||
QuadVertex(nq).SetCoord(X1+Xc,Y1+Yc,Z1+Zc);
|
QuadVertex(nq).SetCoord(X1+Xc,Y1+Yc,Z1+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
||||||
QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE);
|
QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE);
|
||||||
nq++;
|
nq++;
|
||||||
QuadVertex(nq).SetCoord(X2+Xc,Y2+Yc,Z2+Zc);
|
QuadVertex(nq).SetCoord(X2+Xc,Y2+Yc,Z2+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
||||||
QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE);
|
QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE);
|
||||||
nq++;
|
nq++;
|
||||||
QuadVertex(nq).SetCoord(X3+Xc,Y3+Yc,Z3+Zc);
|
QuadVertex(nq).SetCoord(X3+Xc,Y3+Yc,Z3+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
||||||
QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE);
|
QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE);
|
||||||
nq++;
|
nq++;
|
||||||
QuadVertex(nq).SetCoord(X4+Xc,Y4+Yc,Z4+Zc);
|
QuadVertex(nq).SetCoord(X4+Xc,Y4+Yc,Z4+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
||||||
QuadEdge(nq).SetValues(nq,nq-3,Aspect_TOE_VISIBLE);
|
QuadEdge(nq).SetValues(nq,nq-3,Aspect_TOE_VISIBLE);
|
||||||
}
|
}
|
||||||
@ -203,8 +203,8 @@ static void ShadeWithVertex(const Handle(Graphic3d_Group) aGroup,
|
|||||||
static void ShadeWithVertexN(const Handle(Graphic3d_Group) aGroup,
|
static void ShadeWithVertexN(const Handle(Graphic3d_Group) aGroup,
|
||||||
const gp_Pnt aPosition,
|
const gp_Pnt aPosition,
|
||||||
const Standard_Real aRadius,
|
const Standard_Real aRadius,
|
||||||
const Standard_Real aDeflection,
|
const Standard_Real aDeflection,
|
||||||
const Standard_Boolean isText,
|
const Standard_Boolean isText,
|
||||||
const Standard_Boolean isOptText)
|
const Standard_Boolean isOptText)
|
||||||
{
|
{
|
||||||
Standard_Real R1,R2;
|
Standard_Real R1,R2;
|
||||||
@ -220,12 +220,12 @@ static void ShadeWithVertexN(const Handle(Graphic3d_Group) aGroup,
|
|||||||
Standard_Real Dalpha = 2.*Standard_PI/nbpanes;
|
Standard_Real Dalpha = 2.*Standard_PI/nbpanes;
|
||||||
Standard_Integer i,j;
|
Standard_Integer i,j;
|
||||||
|
|
||||||
aPosition.Coord (Xc, Yc, Zc);
|
aPosition.Coord (Xc, Yc, Zc);
|
||||||
if(isText) {
|
if(isText) {
|
||||||
Handle(Graphic3d_AspectText3d) Text3d = new Graphic3d_AspectText3d();
|
Handle(Graphic3d_AspectText3d) Text3d = new Graphic3d_AspectText3d();
|
||||||
Text3d->SetTextureMappedFont(isOptText);
|
Text3d->SetTextureMappedFont(isOptText);
|
||||||
aGroup->SetPrimitivesAspect(Text3d);
|
aGroup->SetPrimitivesAspect(Text3d);
|
||||||
}
|
}
|
||||||
#ifdef G005
|
#ifdef G005
|
||||||
if( Graphic3d_ArrayOfPrimitives::IsEnable() ) {
|
if( Graphic3d_ArrayOfPrimitives::IsEnable() ) {
|
||||||
Handle(Graphic3d_ArrayOfTriangles) ptri =
|
Handle(Graphic3d_ArrayOfTriangles) ptri =
|
||||||
@ -233,8 +233,8 @@ static void ShadeWithVertexN(const Handle(Graphic3d_Group) aGroup,
|
|||||||
Standard_True,Standard_False,Standard_False,Standard_False);
|
Standard_True,Standard_False,Standard_False,Standard_False);
|
||||||
Handle(Graphic3d_ArrayOfQuadrangles) pquad =
|
Handle(Graphic3d_ArrayOfQuadrangles) pquad =
|
||||||
new Graphic3d_ArrayOfQuadrangles(4*nbpanes*(nbpanes/2-2),0,
|
new Graphic3d_ArrayOfQuadrangles(4*nbpanes*(nbpanes/2-2),0,
|
||||||
Standard_True,Standard_False,Standard_False,Standard_False);
|
Standard_True,Standard_False,Standard_False,Standard_False);
|
||||||
aGroup->BeginPrimitives();
|
aGroup->BeginPrimitives();
|
||||||
for( j=0; j<nbpanes/2; j++ ) {
|
for( j=0; j<nbpanes/2; j++ ) {
|
||||||
Alpha = 0.;
|
Alpha = 0.;
|
||||||
R1 = aRadius*sin(Beta);
|
R1 = aRadius*sin(Beta);
|
||||||
@ -253,38 +253,38 @@ static void ShadeWithVertexN(const Handle(Graphic3d_Group) aGroup,
|
|||||||
X4 = R1*cos(Alpha);
|
X4 = R1*cos(Alpha);
|
||||||
Y4 = R1*sin(Alpha);
|
Y4 = R1*sin(Alpha);
|
||||||
if( j == 0 ) {
|
if( j == 0 ) {
|
||||||
ptri->AddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc),
|
ptri->AddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc),
|
||||||
gp_Vec(X1/aRadius,Y1/aRadius,Z1/aRadius));
|
gp_Vec(X1/aRadius,Y1/aRadius,Z1/aRadius));
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
||||||
ptri->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc),
|
ptri->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc),
|
||||||
gp_Vec(X2/aRadius,Y2/aRadius,Z2/aRadius));
|
gp_Vec(X2/aRadius,Y2/aRadius,Z2/aRadius));
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
||||||
ptri->AddVertex(gp_Pnt(X3+Xc,Y3+Yc,Z3+Zc),
|
ptri->AddVertex(gp_Pnt(X3+Xc,Y3+Yc,Z3+Zc),
|
||||||
gp_Vec(X3/aRadius,Y3/aRadius,Z3/aRadius));
|
gp_Vec(X3/aRadius,Y3/aRadius,Z3/aRadius));
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
||||||
} else if( j == nbpanes/2-1 ) {
|
} else if( j == nbpanes/2-1 ) {
|
||||||
ptri->AddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc),
|
ptri->AddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc),
|
||||||
gp_Vec(X1/aRadius,Y1/aRadius,Z1/aRadius));
|
gp_Vec(X1/aRadius,Y1/aRadius,Z1/aRadius));
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
||||||
ptri->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc),
|
ptri->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc),
|
||||||
gp_Vec(X2/aRadius,Y2/aRadius,Z2/aRadius));
|
gp_Vec(X2/aRadius,Y2/aRadius,Z2/aRadius));
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
||||||
ptri->AddVertex(gp_Pnt(X4+Xc,Y4+Yc,Z4+Zc),
|
ptri->AddVertex(gp_Pnt(X4+Xc,Y4+Yc,Z4+Zc),
|
||||||
gp_Vec(X4/aRadius,Y4/aRadius,Z4/aRadius));
|
gp_Vec(X4/aRadius,Y4/aRadius,Z4/aRadius));
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
||||||
} else {
|
} else {
|
||||||
pquad->AddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc),
|
pquad->AddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc),
|
||||||
gp_Vec(X1/aRadius,Y1/aRadius,Z1/aRadius));
|
gp_Vec(X1/aRadius,Y1/aRadius,Z1/aRadius));
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
||||||
pquad->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc),
|
pquad->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc),
|
||||||
gp_Vec(X2/aRadius,Y2/aRadius,Z2/aRadius));
|
gp_Vec(X2/aRadius,Y2/aRadius,Z2/aRadius));
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
||||||
pquad->AddVertex(gp_Pnt(X3+Xc,Y3+Yc,Z3+Zc),
|
pquad->AddVertex(gp_Pnt(X3+Xc,Y3+Yc,Z3+Zc),
|
||||||
gp_Vec(X3/aRadius,Y3/aRadius,Z3/aRadius));
|
gp_Vec(X3/aRadius,Y3/aRadius,Z3/aRadius));
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
||||||
pquad->AddVertex(gp_Pnt(X4+Xc,Y4+Yc,Z4+Zc),
|
pquad->AddVertex(gp_Pnt(X4+Xc,Y4+Yc,Z4+Zc),
|
||||||
gp_Vec(X4/aRadius,Y4/aRadius,Z4/aRadius));
|
gp_Vec(X4/aRadius,Y4/aRadius,Z4/aRadius));
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -294,8 +294,8 @@ static void ShadeWithVertexN(const Handle(Graphic3d_Group) aGroup,
|
|||||||
aGroup->EndPrimitives();
|
aGroup->EndPrimitives();
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
aGroup->BeginPrimitives();
|
aGroup->BeginPrimitives();
|
||||||
Graphic3d_Array1OfVertexN TriVertex(1,3*nbpanes*2);
|
Graphic3d_Array1OfVertexN TriVertex(1,3*nbpanes*2);
|
||||||
Graphic3d_Array1OfVertexN QuadVertex(1,4*nbpanes*(nbpanes/2-2));
|
Graphic3d_Array1OfVertexN QuadVertex(1,4*nbpanes*(nbpanes/2-2));
|
||||||
Aspect_Array1OfEdge TriEdge(1,3*nbpanes*2);
|
Aspect_Array1OfEdge TriEdge(1,3*nbpanes*2);
|
||||||
@ -321,54 +321,54 @@ static void ShadeWithVertexN(const Handle(Graphic3d_Group) aGroup,
|
|||||||
if( j == 0 ) {
|
if( j == 0 ) {
|
||||||
nt++;
|
nt++;
|
||||||
TriVertex(nt).SetCoord(X1+Xc,Y1+Yc,Z1+Zc);
|
TriVertex(nt).SetCoord(X1+Xc,Y1+Yc,Z1+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
||||||
TriVertex(nt).SetNormal(X1/aRadius,Y1/aRadius,Z1/aRadius);
|
TriVertex(nt).SetNormal(X1/aRadius,Y1/aRadius,Z1/aRadius);
|
||||||
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
||||||
nt++;
|
nt++;
|
||||||
TriVertex(nt).SetCoord(X2+Xc,Y2+Yc,Z2+Zc);
|
TriVertex(nt).SetCoord(X2+Xc,Y2+Yc,Z2+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
||||||
TriVertex(nt).SetNormal(X2/aRadius,Y2/aRadius,Z2/aRadius);
|
TriVertex(nt).SetNormal(X2/aRadius,Y2/aRadius,Z2/aRadius);
|
||||||
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
||||||
nt++;
|
nt++;
|
||||||
TriVertex(nt).SetCoord(X3+Xc,Y3+Yc,Z3+Zc);
|
TriVertex(nt).SetCoord(X3+Xc,Y3+Yc,Z3+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
||||||
TriVertex(nt).SetNormal(X3/aRadius,Y3/aRadius,Z3/aRadius);
|
TriVertex(nt).SetNormal(X3/aRadius,Y3/aRadius,Z3/aRadius);
|
||||||
TriEdge(nt).SetValues(nt,nt-2,Aspect_TOE_VISIBLE);
|
TriEdge(nt).SetValues(nt,nt-2,Aspect_TOE_VISIBLE);
|
||||||
} else if( j == nbpanes/2-1 ) {
|
} else if( j == nbpanes/2-1 ) {
|
||||||
nt++;
|
nt++;
|
||||||
TriVertex(nt).SetCoord(X1+Xc,Y1+Yc,Z1+Zc);
|
TriVertex(nt).SetCoord(X1+Xc,Y1+Yc,Z1+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
||||||
TriVertex(nt).SetNormal(X1/aRadius,Y1/aRadius,Z1/aRadius);
|
TriVertex(nt).SetNormal(X1/aRadius,Y1/aRadius,Z1/aRadius);
|
||||||
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
||||||
nt++;
|
nt++;
|
||||||
TriVertex(nt).SetCoord(X2+Xc,Y2+Yc,Z2+Zc);
|
TriVertex(nt).SetCoord(X2+Xc,Y2+Yc,Z2+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
||||||
TriVertex(nt).SetNormal(X2/aRadius,Y2/aRadius,Z2/aRadius);
|
TriVertex(nt).SetNormal(X2/aRadius,Y2/aRadius,Z2/aRadius);
|
||||||
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
||||||
nt++;
|
nt++;
|
||||||
TriVertex(nt).SetCoord(X4+Xc,Y4+Yc,Z4+Zc);
|
TriVertex(nt).SetCoord(X4+Xc,Y4+Yc,Z4+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
||||||
TriVertex(nt).SetNormal(X4/aRadius,Y4/aRadius,Z4/aRadius);
|
TriVertex(nt).SetNormal(X4/aRadius,Y4/aRadius,Z4/aRadius);
|
||||||
TriEdge(nt).SetValues(nt,nt-2,Aspect_TOE_VISIBLE);
|
TriEdge(nt).SetValues(nt,nt-2,Aspect_TOE_VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
nq++;
|
nq++;
|
||||||
QuadVertex(nq).SetCoord(X1+Xc,Y1+Yc,Z1+Zc);
|
QuadVertex(nq).SetCoord(X1+Xc,Y1+Yc,Z1+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
||||||
QuadVertex(nq).SetNormal(X1/aRadius,Y1/aRadius,Z1/aRadius);
|
QuadVertex(nq).SetNormal(X1/aRadius,Y1/aRadius,Z1/aRadius);
|
||||||
QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE);
|
QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE);
|
||||||
nq++;
|
nq++;
|
||||||
QuadVertex(nq).SetCoord(X2+Xc,Y2+Yc,Z2+Zc);
|
QuadVertex(nq).SetCoord(X2+Xc,Y2+Yc,Z2+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
||||||
QuadVertex(nq).SetNormal(X2/aRadius,Y2/aRadius,Z2/aRadius);
|
QuadVertex(nq).SetNormal(X2/aRadius,Y2/aRadius,Z2/aRadius);
|
||||||
QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE);
|
QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE);
|
||||||
nq++;
|
nq++;
|
||||||
QuadVertex(nq).SetCoord(X3+Xc,Y3+Yc,Z3+Zc);
|
QuadVertex(nq).SetCoord(X3+Xc,Y3+Yc,Z3+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
||||||
QuadVertex(nq).SetNormal(X3/aRadius,Y3/aRadius,Z3/aRadius);
|
QuadVertex(nq).SetNormal(X3/aRadius,Y3/aRadius,Z3/aRadius);
|
||||||
QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE);
|
QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE);
|
||||||
nq++;
|
nq++;
|
||||||
QuadVertex(nq).SetCoord(X4+Xc,Y4+Yc,Z4+Zc);
|
QuadVertex(nq).SetCoord(X4+Xc,Y4+Yc,Z4+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
||||||
QuadVertex(nq).SetNormal(X4/aRadius,Y4/aRadius,Z4/aRadius);
|
QuadVertex(nq).SetNormal(X4/aRadius,Y4/aRadius,Z4/aRadius);
|
||||||
QuadEdge(nq).SetValues(nq,nq-3,Aspect_TOE_VISIBLE);
|
QuadEdge(nq).SetValues(nq,nq-3,Aspect_TOE_VISIBLE);
|
||||||
}
|
}
|
||||||
@ -384,8 +384,8 @@ static void ShadeWithVertexN(const Handle(Graphic3d_Group) aGroup,
|
|||||||
static void ShadeWithVertexC(const Handle(Graphic3d_Group) aGroup,
|
static void ShadeWithVertexC(const Handle(Graphic3d_Group) aGroup,
|
||||||
const gp_Pnt aPosition,
|
const gp_Pnt aPosition,
|
||||||
const Standard_Real aRadius,
|
const Standard_Real aRadius,
|
||||||
const Standard_Real aDeflection,
|
const Standard_Real aDeflection,
|
||||||
const Standard_Boolean isText,
|
const Standard_Boolean isText,
|
||||||
const Standard_Boolean isOptText)
|
const Standard_Boolean isOptText)
|
||||||
{
|
{
|
||||||
Standard_Real R1,R2;
|
Standard_Real R1,R2;
|
||||||
@ -403,11 +403,11 @@ static void ShadeWithVertexC(const Handle(Graphic3d_Group) aGroup,
|
|||||||
Standard_Integer i,j;
|
Standard_Integer i,j;
|
||||||
|
|
||||||
aPosition.Coord (Xc, Yc, Zc);
|
aPosition.Coord (Xc, Yc, Zc);
|
||||||
if(isText) {
|
if(isText) {
|
||||||
Handle(Graphic3d_AspectText3d) Text3d = new Graphic3d_AspectText3d();
|
Handle(Graphic3d_AspectText3d) Text3d = new Graphic3d_AspectText3d();
|
||||||
Text3d->SetTextureMappedFont(isOptText);
|
Text3d->SetTextureMappedFont(isOptText);
|
||||||
aGroup->SetPrimitivesAspect(Text3d);
|
aGroup->SetPrimitivesAspect(Text3d);
|
||||||
}
|
}
|
||||||
#ifdef G005
|
#ifdef G005
|
||||||
if( Graphic3d_ArrayOfPrimitives::IsEnable() ) {
|
if( Graphic3d_ArrayOfPrimitives::IsEnable() ) {
|
||||||
Handle(Graphic3d_ArrayOfTriangles) ptri =
|
Handle(Graphic3d_ArrayOfTriangles) ptri =
|
||||||
@ -416,7 +416,7 @@ static void ShadeWithVertexC(const Handle(Graphic3d_Group) aGroup,
|
|||||||
Handle(Graphic3d_ArrayOfQuadrangles) pquad =
|
Handle(Graphic3d_ArrayOfQuadrangles) pquad =
|
||||||
new Graphic3d_ArrayOfQuadrangles(4*nbpanes*(nbpanes/2-2),0,
|
new Graphic3d_ArrayOfQuadrangles(4*nbpanes*(nbpanes/2-2),0,
|
||||||
Standard_False,Standard_True,Standard_False,Standard_False);
|
Standard_False,Standard_True,Standard_False,Standard_False);
|
||||||
aGroup->BeginPrimitives();
|
aGroup->BeginPrimitives();
|
||||||
for( j=0; j<nbpanes/2; j++ ) {
|
for( j=0; j<nbpanes/2; j++ ) {
|
||||||
Alpha = 0.;
|
Alpha = 0.;
|
||||||
R1 = aRadius*sin(Beta);
|
R1 = aRadius*sin(Beta);
|
||||||
@ -444,27 +444,27 @@ static void ShadeWithVertexC(const Handle(Graphic3d_Group) aGroup,
|
|||||||
0.5+Y4/aRadius/2.,0.5+Z4/aRadius/2.,Quantity_TOC_RGB);
|
0.5+Y4/aRadius/2.,0.5+Z4/aRadius/2.,Quantity_TOC_RGB);
|
||||||
if( j == 0 ) {
|
if( j == 0 ) {
|
||||||
ptri->AddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc),C1);
|
ptri->AddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc),C1);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
||||||
ptri->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc),C2);
|
ptri->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc),C2);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
||||||
ptri->AddVertex(gp_Pnt(X3+Xc,Y3+Yc,Z3+Zc),C3);
|
ptri->AddVertex(gp_Pnt(X3+Xc,Y3+Yc,Z3+Zc),C3);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
||||||
} else if( j == nbpanes/2-1 ) {
|
} else if( j == nbpanes/2-1 ) {
|
||||||
ptri->AddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc),C1);
|
ptri->AddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc),C1);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
||||||
ptri->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc),C2);
|
ptri->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc),C2);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
||||||
ptri->AddVertex(gp_Pnt(X4+Xc,Y4+Yc,Z4+Zc),C4);
|
ptri->AddVertex(gp_Pnt(X4+Xc,Y4+Yc,Z4+Zc),C4);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
||||||
} else {
|
} else {
|
||||||
pquad->AddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc),C1);
|
pquad->AddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc),C1);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
||||||
pquad->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc),C2);
|
pquad->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc),C2);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
||||||
pquad->AddVertex(gp_Pnt(X3+Xc,Y3+Yc,Z3+Zc),C3);
|
pquad->AddVertex(gp_Pnt(X3+Xc,Y3+Yc,Z3+Zc),C3);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
||||||
pquad->AddVertex(gp_Pnt(X4+Xc,Y4+Yc,Z4+Zc),C4);
|
pquad->AddVertex(gp_Pnt(X4+Xc,Y4+Yc,Z4+Zc),C4);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -475,7 +475,7 @@ static void ShadeWithVertexC(const Handle(Graphic3d_Group) aGroup,
|
|||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
aGroup->BeginPrimitives();
|
aGroup->BeginPrimitives();
|
||||||
Graphic3d_Array1OfVertexC TriVertex(1,3*nbpanes*2);
|
Graphic3d_Array1OfVertexC TriVertex(1,3*nbpanes*2);
|
||||||
Graphic3d_Array1OfVertexC QuadVertex(1,4*nbpanes*(nbpanes/2-2));
|
Graphic3d_Array1OfVertexC QuadVertex(1,4*nbpanes*(nbpanes/2-2));
|
||||||
Aspect_Array1OfEdge TriEdge(1,3*nbpanes*2);
|
Aspect_Array1OfEdge TriEdge(1,3*nbpanes*2);
|
||||||
@ -509,54 +509,54 @@ static void ShadeWithVertexC(const Handle(Graphic3d_Group) aGroup,
|
|||||||
if( j == 0 ) {
|
if( j == 0 ) {
|
||||||
nt++;
|
nt++;
|
||||||
TriVertex(nt).SetCoord(X1+Xc,Y1+Yc,Z1+Zc);
|
TriVertex(nt).SetCoord(X1+Xc,Y1+Yc,Z1+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
||||||
TriVertex(nt).SetColor(C1);
|
TriVertex(nt).SetColor(C1);
|
||||||
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
||||||
nt++;
|
nt++;
|
||||||
TriVertex(nt).SetCoord(X2+Xc,Y2+Yc,Z2+Zc);
|
TriVertex(nt).SetCoord(X2+Xc,Y2+Yc,Z2+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
||||||
TriVertex(nt).SetColor(C2);
|
TriVertex(nt).SetColor(C2);
|
||||||
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
||||||
nt++;
|
nt++;
|
||||||
TriVertex(nt).SetCoord(X3+Xc,Y3+Yc,Z3+Zc);
|
TriVertex(nt).SetCoord(X3+Xc,Y3+Yc,Z3+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
||||||
TriVertex(nt).SetColor(C3);
|
TriVertex(nt).SetColor(C3);
|
||||||
TriEdge(nt).SetValues(nt,nt-2,Aspect_TOE_VISIBLE);
|
TriEdge(nt).SetValues(nt,nt-2,Aspect_TOE_VISIBLE);
|
||||||
} else if( j == nbpanes/2-1 ) {
|
} else if( j == nbpanes/2-1 ) {
|
||||||
nt++;
|
nt++;
|
||||||
TriVertex(nt).SetCoord(X1+Xc,Y1+Yc,Z1+Zc);
|
TriVertex(nt).SetCoord(X1+Xc,Y1+Yc,Z1+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
||||||
TriVertex(nt).SetColor(C1);
|
TriVertex(nt).SetColor(C1);
|
||||||
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
||||||
nt++;
|
nt++;
|
||||||
TriVertex(nt).SetCoord(X2+Xc,Y2+Yc,Z2+Zc);
|
TriVertex(nt).SetCoord(X2+Xc,Y2+Yc,Z2+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
||||||
TriVertex(nt).SetColor(C2);
|
TriVertex(nt).SetColor(C2);
|
||||||
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
||||||
nt++;
|
nt++;
|
||||||
TriVertex(nt).SetCoord(X4+Xc,Y4+Yc,Z4+Zc);
|
TriVertex(nt).SetCoord(X4+Xc,Y4+Yc,Z4+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
||||||
TriVertex(nt).SetColor(C4);
|
TriVertex(nt).SetColor(C4);
|
||||||
TriEdge(nt).SetValues(nt,nt-2,Aspect_TOE_VISIBLE);
|
TriEdge(nt).SetValues(nt,nt-2,Aspect_TOE_VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
nq++;
|
nq++;
|
||||||
QuadVertex(nq).SetCoord(X1+Xc,Y1+Yc,Z1+Zc);
|
QuadVertex(nq).SetCoord(X1+Xc,Y1+Yc,Z1+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
||||||
QuadVertex(nq).SetColor(C1);
|
QuadVertex(nq).SetColor(C1);
|
||||||
QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE);
|
QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE);
|
||||||
nq++;
|
nq++;
|
||||||
QuadVertex(nq).SetCoord(X2+Xc,Y2+Yc,Z2+Zc);
|
QuadVertex(nq).SetCoord(X2+Xc,Y2+Yc,Z2+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
||||||
QuadVertex(nq).SetColor(C2);
|
QuadVertex(nq).SetColor(C2);
|
||||||
QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE);
|
QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE);
|
||||||
nq++;
|
nq++;
|
||||||
QuadVertex(nq).SetCoord(X3+Xc,Y3+Yc,Z3+Zc);
|
QuadVertex(nq).SetCoord(X3+Xc,Y3+Yc,Z3+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
||||||
QuadVertex(nq).SetColor(C3);
|
QuadVertex(nq).SetColor(C3);
|
||||||
QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE);
|
QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE);
|
||||||
nq++;
|
nq++;
|
||||||
QuadVertex(nq).SetCoord(X4+Xc,Y4+Yc,Z4+Zc);
|
QuadVertex(nq).SetCoord(X4+Xc,Y4+Yc,Z4+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
||||||
QuadVertex(nq).SetColor(C4);
|
QuadVertex(nq).SetColor(C4);
|
||||||
QuadEdge(nq).SetValues(nq,nq-3,Aspect_TOE_VISIBLE);
|
QuadEdge(nq).SetValues(nq,nq-3,Aspect_TOE_VISIBLE);
|
||||||
}
|
}
|
||||||
@ -572,8 +572,8 @@ static void ShadeWithVertexC(const Handle(Graphic3d_Group) aGroup,
|
|||||||
static void ShadeWithVertexNC(const Handle(Graphic3d_Group) aGroup,
|
static void ShadeWithVertexNC(const Handle(Graphic3d_Group) aGroup,
|
||||||
const gp_Pnt aPosition,
|
const gp_Pnt aPosition,
|
||||||
const Standard_Real aRadius,
|
const Standard_Real aRadius,
|
||||||
const Standard_Real aDeflection,
|
const Standard_Real aDeflection,
|
||||||
const Standard_Boolean isText,
|
const Standard_Boolean isText,
|
||||||
const Standard_Boolean isOptText)
|
const Standard_Boolean isOptText)
|
||||||
{
|
{
|
||||||
Standard_Real R1,R2;
|
Standard_Real R1,R2;
|
||||||
@ -591,11 +591,11 @@ static void ShadeWithVertexNC(const Handle(Graphic3d_Group) aGroup,
|
|||||||
Standard_Integer i,j;
|
Standard_Integer i,j;
|
||||||
|
|
||||||
aPosition.Coord (Xc, Yc, Zc);
|
aPosition.Coord (Xc, Yc, Zc);
|
||||||
if(isText) {
|
if(isText) {
|
||||||
Handle(Graphic3d_AspectText3d) Text3d = new Graphic3d_AspectText3d();
|
Handle(Graphic3d_AspectText3d) Text3d = new Graphic3d_AspectText3d();
|
||||||
Text3d->SetTextureMappedFont(isOptText);
|
Text3d->SetTextureMappedFont(isOptText);
|
||||||
aGroup->SetPrimitivesAspect(Text3d);
|
aGroup->SetPrimitivesAspect(Text3d);
|
||||||
}
|
}
|
||||||
#ifdef G005
|
#ifdef G005
|
||||||
if( Graphic3d_ArrayOfPrimitives::IsEnable() ) {
|
if( Graphic3d_ArrayOfPrimitives::IsEnable() ) {
|
||||||
Handle(Graphic3d_ArrayOfTriangles) ptri =
|
Handle(Graphic3d_ArrayOfTriangles) ptri =
|
||||||
@ -604,7 +604,7 @@ static void ShadeWithVertexNC(const Handle(Graphic3d_Group) aGroup,
|
|||||||
Handle(Graphic3d_ArrayOfQuadrangles) pquad =
|
Handle(Graphic3d_ArrayOfQuadrangles) pquad =
|
||||||
new Graphic3d_ArrayOfQuadrangles(4*nbpanes*(nbpanes/2-2),0,
|
new Graphic3d_ArrayOfQuadrangles(4*nbpanes*(nbpanes/2-2),0,
|
||||||
Standard_True,Standard_True,Standard_False,Standard_False);
|
Standard_True,Standard_True,Standard_False,Standard_False);
|
||||||
aGroup->BeginPrimitives();
|
aGroup->BeginPrimitives();
|
||||||
for( j=0; j<nbpanes/2; j++ ) {
|
for( j=0; j<nbpanes/2; j++ ) {
|
||||||
Alpha = 0.;
|
Alpha = 0.;
|
||||||
R1 = aRadius*sin(Beta);
|
R1 = aRadius*sin(Beta);
|
||||||
@ -633,36 +633,36 @@ static void ShadeWithVertexNC(const Handle(Graphic3d_Group) aGroup,
|
|||||||
if( j == 0 ) {
|
if( j == 0 ) {
|
||||||
ptri->AddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc),
|
ptri->AddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc),
|
||||||
gp_Vec(X1/aRadius,Y1/aRadius,Z1/aRadius),C1);
|
gp_Vec(X1/aRadius,Y1/aRadius,Z1/aRadius),C1);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
||||||
ptri->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc),
|
ptri->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc),
|
||||||
gp_Vec(X2/aRadius,Y2/aRadius,Z2/aRadius),C2);
|
gp_Vec(X2/aRadius,Y2/aRadius,Z2/aRadius),C2);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
||||||
ptri->AddVertex(gp_Pnt(X3+Xc,Y3+Yc,Z3+Zc),
|
ptri->AddVertex(gp_Pnt(X3+Xc,Y3+Yc,Z3+Zc),
|
||||||
gp_Vec(X3/aRadius,Y3/aRadius,Z3/aRadius),C3);
|
gp_Vec(X3/aRadius,Y3/aRadius,Z3/aRadius),C3);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
||||||
} else if( j == nbpanes/2-1 ) {
|
} else if( j == nbpanes/2-1 ) {
|
||||||
ptri->AddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc),
|
ptri->AddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc),
|
||||||
gp_Vec(X1/aRadius,Y1/aRadius,Z1/aRadius),C1);
|
gp_Vec(X1/aRadius,Y1/aRadius,Z1/aRadius),C1);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
||||||
ptri->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc),
|
ptri->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc),
|
||||||
gp_Vec(X2/aRadius,Y2/aRadius,Z2/aRadius),C2);
|
gp_Vec(X2/aRadius,Y2/aRadius,Z2/aRadius),C2);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
||||||
ptri->AddVertex(gp_Pnt(X4+Xc,Y4+Yc,Z4+Zc),
|
ptri->AddVertex(gp_Pnt(X4+Xc,Y4+Yc,Z4+Zc),
|
||||||
gp_Vec(X4/aRadius,Y4/aRadius,Z4/aRadius),C4);
|
gp_Vec(X4/aRadius,Y4/aRadius,Z4/aRadius),C4);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
||||||
} else {
|
} else {
|
||||||
pquad->AddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc),
|
pquad->AddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc),
|
||||||
gp_Vec(X1/aRadius,Y1/aRadius,Z1/aRadius),C1);
|
gp_Vec(X1/aRadius,Y1/aRadius,Z1/aRadius),C1);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
||||||
pquad->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc),
|
pquad->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc),
|
||||||
gp_Vec(X2/aRadius,Y2/aRadius,Z2/aRadius),C2);
|
gp_Vec(X2/aRadius,Y2/aRadius,Z2/aRadius),C2);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
||||||
pquad->AddVertex(gp_Pnt(X3+Xc,Y3+Yc,Z3+Zc),
|
pquad->AddVertex(gp_Pnt(X3+Xc,Y3+Yc,Z3+Zc),
|
||||||
gp_Vec(X3/aRadius,Y3/aRadius,Z3/aRadius),C3);
|
gp_Vec(X3/aRadius,Y3/aRadius,Z3/aRadius),C3);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
||||||
pquad->AddVertex(gp_Pnt(X4+Xc,Y4+Yc,Z4+Zc),
|
pquad->AddVertex(gp_Pnt(X4+Xc,Y4+Yc,Z4+Zc),
|
||||||
gp_Vec(X4/aRadius,Y4/aRadius,Z4/aRadius),C4);
|
gp_Vec(X4/aRadius,Y4/aRadius,Z4/aRadius),C4);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -673,7 +673,7 @@ static void ShadeWithVertexNC(const Handle(Graphic3d_Group) aGroup,
|
|||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
aGroup->BeginPrimitives();
|
aGroup->BeginPrimitives();
|
||||||
Graphic3d_Array1OfVertexNC TriVertex(1,3*nbpanes*2);
|
Graphic3d_Array1OfVertexNC TriVertex(1,3*nbpanes*2);
|
||||||
Graphic3d_Array1OfVertexNC QuadVertex(1,4*nbpanes*(nbpanes/2-2));
|
Graphic3d_Array1OfVertexNC QuadVertex(1,4*nbpanes*(nbpanes/2-2));
|
||||||
Aspect_Array1OfEdge TriEdge(1,3*nbpanes*2);
|
Aspect_Array1OfEdge TriEdge(1,3*nbpanes*2);
|
||||||
@ -707,63 +707,63 @@ static void ShadeWithVertexNC(const Handle(Graphic3d_Group) aGroup,
|
|||||||
if( j == 0 ) {
|
if( j == 0 ) {
|
||||||
nt++;
|
nt++;
|
||||||
TriVertex(nt).SetCoord(X1+Xc,Y1+Yc,Z1+Zc);
|
TriVertex(nt).SetCoord(X1+Xc,Y1+Yc,Z1+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
||||||
TriVertex(nt).SetNormal(X1/aRadius,Y1/aRadius,Z1/aRadius);
|
TriVertex(nt).SetNormal(X1/aRadius,Y1/aRadius,Z1/aRadius);
|
||||||
TriVertex(nt).SetColor(C1);
|
TriVertex(nt).SetColor(C1);
|
||||||
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
||||||
nt++;
|
nt++;
|
||||||
TriVertex(nt).SetCoord(X2+Xc,Y2+Yc,Z2+Zc);
|
TriVertex(nt).SetCoord(X2+Xc,Y2+Yc,Z2+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
||||||
TriVertex(nt).SetNormal(X2/aRadius,Y2/aRadius,Z2/aRadius);
|
TriVertex(nt).SetNormal(X2/aRadius,Y2/aRadius,Z2/aRadius);
|
||||||
TriVertex(nt).SetColor(C2);
|
TriVertex(nt).SetColor(C2);
|
||||||
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
||||||
nt++;
|
nt++;
|
||||||
TriVertex(nt).SetCoord(X3+Xc,Y3+Yc,Z3+Zc);
|
TriVertex(nt).SetCoord(X3+Xc,Y3+Yc,Z3+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
||||||
TriVertex(nt).SetNormal(X3/aRadius,Y3/aRadius,Z3/aRadius);
|
TriVertex(nt).SetNormal(X3/aRadius,Y3/aRadius,Z3/aRadius);
|
||||||
TriVertex(nt).SetColor(C3);
|
TriVertex(nt).SetColor(C3);
|
||||||
TriEdge(nt).SetValues(nt,nt-2,Aspect_TOE_VISIBLE);
|
TriEdge(nt).SetValues(nt,nt-2,Aspect_TOE_VISIBLE);
|
||||||
} else if( j == nbpanes/2-1 ) {
|
} else if( j == nbpanes/2-1 ) {
|
||||||
nt++;
|
nt++;
|
||||||
TriVertex(nt).SetCoord(X1+Xc,Y1+Yc,Z1+Zc);
|
TriVertex(nt).SetCoord(X1+Xc,Y1+Yc,Z1+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
||||||
TriVertex(nt).SetNormal(X1/aRadius,Y1/aRadius,Z1/aRadius);
|
TriVertex(nt).SetNormal(X1/aRadius,Y1/aRadius,Z1/aRadius);
|
||||||
TriVertex(nt).SetColor(C1);
|
TriVertex(nt).SetColor(C1);
|
||||||
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
||||||
nt++;
|
nt++;
|
||||||
TriVertex(nt).SetCoord(X2+Xc,Y2+Yc,Z2+Zc);
|
TriVertex(nt).SetCoord(X2+Xc,Y2+Yc,Z2+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
||||||
TriVertex(nt).SetNormal(X2/aRadius,Y2/aRadius,Z2/aRadius);
|
TriVertex(nt).SetNormal(X2/aRadius,Y2/aRadius,Z2/aRadius);
|
||||||
TriVertex(nt).SetColor(C2);
|
TriVertex(nt).SetColor(C2);
|
||||||
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
||||||
nt++;
|
nt++;
|
||||||
TriVertex(nt).SetCoord(X4+Xc,Y4+Yc,Z4+Zc);
|
TriVertex(nt).SetCoord(X4+Xc,Y4+Yc,Z4+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
||||||
TriVertex(nt).SetNormal(X4/aRadius,Y4/aRadius,Z4/aRadius);
|
TriVertex(nt).SetNormal(X4/aRadius,Y4/aRadius,Z4/aRadius);
|
||||||
TriVertex(nt).SetColor(C4);
|
TriVertex(nt).SetColor(C4);
|
||||||
TriEdge(nt).SetValues(nt,nt-2,Aspect_TOE_VISIBLE);
|
TriEdge(nt).SetValues(nt,nt-2,Aspect_TOE_VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
nq++;
|
nq++;
|
||||||
QuadVertex(nq).SetCoord(X1+Xc,Y1+Yc,Z1+Zc);
|
QuadVertex(nq).SetCoord(X1+Xc,Y1+Yc,Z1+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
||||||
QuadVertex(nq).SetNormal(X1/aRadius,Y1/aRadius,Z1/aRadius);
|
QuadVertex(nq).SetNormal(X1/aRadius,Y1/aRadius,Z1/aRadius);
|
||||||
QuadVertex(nq).SetColor(C1);
|
QuadVertex(nq).SetColor(C1);
|
||||||
QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE);
|
QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE);
|
||||||
nq++;
|
nq++;
|
||||||
QuadVertex(nq).SetCoord(X2+Xc,Y2+Yc,Z2+Zc);
|
QuadVertex(nq).SetCoord(X2+Xc,Y2+Yc,Z2+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
||||||
QuadVertex(nq).SetNormal(X2/aRadius,Y2/aRadius,Z2/aRadius);
|
QuadVertex(nq).SetNormal(X2/aRadius,Y2/aRadius,Z2/aRadius);
|
||||||
QuadVertex(nq).SetColor(C2);
|
QuadVertex(nq).SetColor(C2);
|
||||||
QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE);
|
QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE);
|
||||||
nq++;
|
nq++;
|
||||||
QuadVertex(nq).SetCoord(X3+Xc,Y3+Yc,Z3+Zc);
|
QuadVertex(nq).SetCoord(X3+Xc,Y3+Yc,Z3+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
||||||
QuadVertex(nq).SetNormal(X3/aRadius,Y3/aRadius,Z3/aRadius);
|
QuadVertex(nq).SetNormal(X3/aRadius,Y3/aRadius,Z3/aRadius);
|
||||||
QuadVertex(nq).SetColor(C3);
|
QuadVertex(nq).SetColor(C3);
|
||||||
QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE);
|
QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE);
|
||||||
nq++;
|
nq++;
|
||||||
QuadVertex(nq).SetCoord(X4+Xc,Y4+Yc,Z4+Zc);
|
QuadVertex(nq).SetCoord(X4+Xc,Y4+Yc,Z4+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
||||||
QuadVertex(nq).SetNormal(X4/aRadius,Y4/aRadius,Z4/aRadius);
|
QuadVertex(nq).SetNormal(X4/aRadius,Y4/aRadius,Z4/aRadius);
|
||||||
QuadVertex(nq).SetColor(C4);
|
QuadVertex(nq).SetColor(C4);
|
||||||
QuadEdge(nq).SetValues(nq,nq-3,Aspect_TOE_VISIBLE);
|
QuadEdge(nq).SetValues(nq,nq-3,Aspect_TOE_VISIBLE);
|
||||||
@ -780,8 +780,8 @@ static void ShadeWithVertexNC(const Handle(Graphic3d_Group) aGroup,
|
|||||||
static void ShadeWithVertexNT(const Handle(Graphic3d_Group) aGroup,
|
static void ShadeWithVertexNT(const Handle(Graphic3d_Group) aGroup,
|
||||||
const gp_Pnt aPosition,
|
const gp_Pnt aPosition,
|
||||||
const Standard_Real aRadius,
|
const Standard_Real aRadius,
|
||||||
const Standard_Real aDeflection,
|
const Standard_Real aDeflection,
|
||||||
const Standard_Boolean isText,
|
const Standard_Boolean isText,
|
||||||
const Standard_Boolean isOptText)
|
const Standard_Boolean isOptText)
|
||||||
{
|
{
|
||||||
Standard_Real R1,R2;
|
Standard_Real R1,R2;
|
||||||
@ -799,11 +799,11 @@ static void ShadeWithVertexNT(const Handle(Graphic3d_Group) aGroup,
|
|||||||
Standard_Integer i,j;
|
Standard_Integer i,j;
|
||||||
|
|
||||||
aPosition.Coord (Xc, Yc, Zc);
|
aPosition.Coord (Xc, Yc, Zc);
|
||||||
if(isText) {
|
if(isText) {
|
||||||
Handle(Graphic3d_AspectText3d) Text3d = new Graphic3d_AspectText3d();
|
Handle(Graphic3d_AspectText3d) Text3d = new Graphic3d_AspectText3d();
|
||||||
Text3d->SetTextureMappedFont(isOptText);
|
Text3d->SetTextureMappedFont(isOptText);
|
||||||
aGroup->SetPrimitivesAspect(Text3d);
|
aGroup->SetPrimitivesAspect(Text3d);
|
||||||
}
|
}
|
||||||
#ifdef G005
|
#ifdef G005
|
||||||
if( Graphic3d_ArrayOfPrimitives::IsEnable() ) {
|
if( Graphic3d_ArrayOfPrimitives::IsEnable() ) {
|
||||||
Handle(Graphic3d_ArrayOfTriangles) ptri =
|
Handle(Graphic3d_ArrayOfTriangles) ptri =
|
||||||
@ -812,7 +812,7 @@ static void ShadeWithVertexNT(const Handle(Graphic3d_Group) aGroup,
|
|||||||
Handle(Graphic3d_ArrayOfQuadrangles) pquad =
|
Handle(Graphic3d_ArrayOfQuadrangles) pquad =
|
||||||
new Graphic3d_ArrayOfQuadrangles(4*nbpanes*(nbpanes/2-2),0,
|
new Graphic3d_ArrayOfQuadrangles(4*nbpanes*(nbpanes/2-2),0,
|
||||||
Standard_True,Standard_False,Standard_True,Standard_False);
|
Standard_True,Standard_False,Standard_True,Standard_False);
|
||||||
aGroup->BeginPrimitives();
|
aGroup->BeginPrimitives();
|
||||||
for( j=0; j<nbpanes/2; j++ ) {
|
for( j=0; j<nbpanes/2; j++ ) {
|
||||||
Alpha = 0.;
|
Alpha = 0.;
|
||||||
R1 = aRadius*sin(Beta);
|
R1 = aRadius*sin(Beta);
|
||||||
@ -838,45 +838,45 @@ static void ShadeWithVertexNT(const Handle(Graphic3d_Group) aGroup,
|
|||||||
ptri->AddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc),
|
ptri->AddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc),
|
||||||
gp_Vec(X1/aRadius,Y1/aRadius,Z1/aRadius),
|
gp_Vec(X1/aRadius,Y1/aRadius,Z1/aRadius),
|
||||||
gp_Pnt2d(Tx1,Ty1));
|
gp_Pnt2d(Tx1,Ty1));
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
||||||
ptri->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc),
|
ptri->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc),
|
||||||
gp_Vec(X2/aRadius,Y2/aRadius,Z2/aRadius),
|
gp_Vec(X2/aRadius,Y2/aRadius,Z2/aRadius),
|
||||||
gp_Pnt2d(Tx1,Ty2));
|
gp_Pnt2d(Tx1,Ty2));
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
||||||
ptri->AddVertex(gp_Pnt(X3+Xc,Y3+Yc,Z3+Zc),
|
ptri->AddVertex(gp_Pnt(X3+Xc,Y3+Yc,Z3+Zc),
|
||||||
gp_Vec(X3/aRadius,Y3/aRadius,Z3/aRadius),
|
gp_Vec(X3/aRadius,Y3/aRadius,Z3/aRadius),
|
||||||
gp_Pnt2d(Tx2,Ty2));
|
gp_Pnt2d(Tx2,Ty2));
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
||||||
} else if( j == nbpanes/2-1 ) {
|
} else if( j == nbpanes/2-1 ) {
|
||||||
ptri->AddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc),
|
ptri->AddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc),
|
||||||
gp_Vec(X1/aRadius,Y1/aRadius,Z1/aRadius),
|
gp_Vec(X1/aRadius,Y1/aRadius,Z1/aRadius),
|
||||||
gp_Pnt2d(Tx1,Ty1));
|
gp_Pnt2d(Tx1,Ty1));
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
||||||
ptri->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc),
|
ptri->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc),
|
||||||
gp_Vec(X2/aRadius,Y2/aRadius,Z2/aRadius),
|
gp_Vec(X2/aRadius,Y2/aRadius,Z2/aRadius),
|
||||||
gp_Pnt2d(Tx1,Ty2));
|
gp_Pnt2d(Tx1,Ty2));
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
||||||
ptri->AddVertex(gp_Pnt(X4+Xc,Y4+Yc,Z4+Zc),
|
ptri->AddVertex(gp_Pnt(X4+Xc,Y4+Yc,Z4+Zc),
|
||||||
gp_Vec(X4/aRadius,Y4/aRadius,Z4/aRadius),
|
gp_Vec(X4/aRadius,Y4/aRadius,Z4/aRadius),
|
||||||
gp_Pnt2d(Tx2,Ty1));
|
gp_Pnt2d(Tx2,Ty1));
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
||||||
} else {
|
} else {
|
||||||
pquad->AddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc),
|
pquad->AddVertex(gp_Pnt(X1+Xc,Y1+Yc,Z1+Zc),
|
||||||
gp_Vec(X1/aRadius,Y1/aRadius,Z1/aRadius),
|
gp_Vec(X1/aRadius,Y1/aRadius,Z1/aRadius),
|
||||||
gp_Pnt2d(Tx1,Ty1));
|
gp_Pnt2d(Tx1,Ty1));
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
||||||
pquad->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc),
|
pquad->AddVertex(gp_Pnt(X2+Xc,Y2+Yc,Z2+Zc),
|
||||||
gp_Vec(X2/aRadius,Y2/aRadius,Z2/aRadius),
|
gp_Vec(X2/aRadius,Y2/aRadius,Z2/aRadius),
|
||||||
gp_Pnt2d(Tx1,Ty2));
|
gp_Pnt2d(Tx1,Ty2));
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
||||||
pquad->AddVertex(gp_Pnt(X3+Xc,Y3+Yc,Z3+Zc),
|
pquad->AddVertex(gp_Pnt(X3+Xc,Y3+Yc,Z3+Zc),
|
||||||
gp_Vec(X3/aRadius,Y3/aRadius,Z3/aRadius),
|
gp_Vec(X3/aRadius,Y3/aRadius,Z3/aRadius),
|
||||||
gp_Pnt2d(Tx2,Ty2));
|
gp_Pnt2d(Tx2,Ty2));
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
||||||
pquad->AddVertex(gp_Pnt(X4+Xc,Y4+Yc,Z4+Zc),
|
pquad->AddVertex(gp_Pnt(X4+Xc,Y4+Yc,Z4+Zc),
|
||||||
gp_Vec(X4/aRadius,Y4/aRadius,Z4/aRadius),
|
gp_Vec(X4/aRadius,Y4/aRadius,Z4/aRadius),
|
||||||
gp_Pnt2d(Tx2,Ty1));
|
gp_Pnt2d(Tx2,Ty1));
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -887,7 +887,7 @@ static void ShadeWithVertexNT(const Handle(Graphic3d_Group) aGroup,
|
|||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
aGroup->BeginPrimitives();
|
aGroup->BeginPrimitives();
|
||||||
Graphic3d_Array1OfVertexNT TriVertex(1,3*nbpanes*2);
|
Graphic3d_Array1OfVertexNT TriVertex(1,3*nbpanes*2);
|
||||||
Graphic3d_Array1OfVertexNT QuadVertex(1,4*nbpanes*(nbpanes/2-2));
|
Graphic3d_Array1OfVertexNT QuadVertex(1,4*nbpanes*(nbpanes/2-2));
|
||||||
Aspect_Array1OfEdge TriEdge(1,3*nbpanes*2);
|
Aspect_Array1OfEdge TriEdge(1,3*nbpanes*2);
|
||||||
@ -917,63 +917,63 @@ static void ShadeWithVertexNT(const Handle(Graphic3d_Group) aGroup,
|
|||||||
if( j == 0 ) {
|
if( j == 0 ) {
|
||||||
nt++;
|
nt++;
|
||||||
TriVertex(nt).SetCoord(X1+Xc,Y1+Yc,Z1+Zc);
|
TriVertex(nt).SetCoord(X1+Xc,Y1+Yc,Z1+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
||||||
TriVertex(nt).SetNormal(X1/aRadius,Y1/aRadius,Z1/aRadius);
|
TriVertex(nt).SetNormal(X1/aRadius,Y1/aRadius,Z1/aRadius);
|
||||||
TriVertex(nt).SetTextureCoordinate(Tx1,Ty1);
|
TriVertex(nt).SetTextureCoordinate(Tx1,Ty1);
|
||||||
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
||||||
nt++;
|
nt++;
|
||||||
TriVertex(nt).SetCoord(X2+Xc,Y2+Yc,Z2+Zc);
|
TriVertex(nt).SetCoord(X2+Xc,Y2+Yc,Z2+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
||||||
TriVertex(nt).SetNormal(X2/aRadius,Y2/aRadius,Z2/aRadius);
|
TriVertex(nt).SetNormal(X2/aRadius,Y2/aRadius,Z2/aRadius);
|
||||||
TriVertex(nt).SetTextureCoordinate(Tx1,Ty2);
|
TriVertex(nt).SetTextureCoordinate(Tx1,Ty2);
|
||||||
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
||||||
nt++;
|
nt++;
|
||||||
TriVertex(nt).SetCoord(X3+Xc,Y3+Yc,Z3+Zc);
|
TriVertex(nt).SetCoord(X3+Xc,Y3+Yc,Z3+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
||||||
TriVertex(nt).SetNormal(X3/aRadius,Y3/aRadius,Z3/aRadius);
|
TriVertex(nt).SetNormal(X3/aRadius,Y3/aRadius,Z3/aRadius);
|
||||||
TriVertex(nt).SetTextureCoordinate(Tx2,Ty2);
|
TriVertex(nt).SetTextureCoordinate(Tx2,Ty2);
|
||||||
TriEdge(nt).SetValues(nt,nt-2,Aspect_TOE_VISIBLE);
|
TriEdge(nt).SetValues(nt,nt-2,Aspect_TOE_VISIBLE);
|
||||||
} else if( j == nbpanes/2-1 ) {
|
} else if( j == nbpanes/2-1 ) {
|
||||||
nt++;
|
nt++;
|
||||||
TriVertex(nt).SetCoord(X1+Xc,Y1+Yc,Z1+Zc);
|
TriVertex(nt).SetCoord(X1+Xc,Y1+Yc,Z1+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
||||||
TriVertex(nt).SetNormal(X1/aRadius,Y1/aRadius,Z1/aRadius);
|
TriVertex(nt).SetNormal(X1/aRadius,Y1/aRadius,Z1/aRadius);
|
||||||
TriVertex(nt).SetTextureCoordinate(Tx1,Ty1);
|
TriVertex(nt).SetTextureCoordinate(Tx1,Ty1);
|
||||||
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
||||||
nt++;
|
nt++;
|
||||||
TriVertex(nt).SetCoord(X2+Xc,Y2+Yc,Z2+Zc);
|
TriVertex(nt).SetCoord(X2+Xc,Y2+Yc,Z2+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
||||||
TriVertex(nt).SetNormal(X2/aRadius,Y2/aRadius,Z2/aRadius);
|
TriVertex(nt).SetNormal(X2/aRadius,Y2/aRadius,Z2/aRadius);
|
||||||
TriVertex(nt).SetTextureCoordinate(Tx1,Ty2);
|
TriVertex(nt).SetTextureCoordinate(Tx1,Ty2);
|
||||||
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
TriEdge(nt).SetValues(nt,nt+1,Aspect_TOE_VISIBLE);
|
||||||
nt++;
|
nt++;
|
||||||
TriVertex(nt).SetCoord(X4+Xc,Y4+Yc,Z4+Zc);
|
TriVertex(nt).SetCoord(X4+Xc,Y4+Yc,Z4+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
||||||
TriVertex(nt).SetNormal(X4/aRadius,Y4/aRadius,Z4/aRadius);
|
TriVertex(nt).SetNormal(X4/aRadius,Y4/aRadius,Z4/aRadius);
|
||||||
TriVertex(nt).SetTextureCoordinate(Tx2,Ty1);
|
TriVertex(nt).SetTextureCoordinate(Tx2,Ty1);
|
||||||
TriEdge(nt).SetValues(nt,nt-2,Aspect_TOE_VISIBLE);
|
TriEdge(nt).SetValues(nt,nt-2,Aspect_TOE_VISIBLE);
|
||||||
} else {
|
} else {
|
||||||
nq++;
|
nq++;
|
||||||
QuadVertex(nq).SetCoord(X1+Xc,Y1+Yc,Z1+Zc);
|
QuadVertex(nq).SetCoord(X1+Xc,Y1+Yc,Z1+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X1+Xc,Y1+Yc,Z1+Zc), stTextHeight);
|
||||||
QuadVertex(nq).SetNormal(X1/aRadius,Y1/aRadius,Z1/aRadius);
|
QuadVertex(nq).SetNormal(X1/aRadius,Y1/aRadius,Z1/aRadius);
|
||||||
QuadVertex(nq).SetTextureCoordinate(Tx1,Ty1);
|
QuadVertex(nq).SetTextureCoordinate(Tx1,Ty1);
|
||||||
QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE);
|
QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE);
|
||||||
nq++;
|
nq++;
|
||||||
QuadVertex(nq).SetCoord(X2+Xc,Y2+Yc,Z2+Zc);
|
QuadVertex(nq).SetCoord(X2+Xc,Y2+Yc,Z2+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X2+Xc,Y2+Yc,Z2+Zc), stTextHeight);
|
||||||
QuadVertex(nq).SetNormal(X2/aRadius,Y2/aRadius,Z2/aRadius);
|
QuadVertex(nq).SetNormal(X2/aRadius,Y2/aRadius,Z2/aRadius);
|
||||||
QuadVertex(nq).SetTextureCoordinate(Tx1,Ty2);
|
QuadVertex(nq).SetTextureCoordinate(Tx1,Ty2);
|
||||||
QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE);
|
QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE);
|
||||||
nq++;
|
nq++;
|
||||||
QuadVertex(nq).SetCoord(X3+Xc,Y3+Yc,Z3+Zc);
|
QuadVertex(nq).SetCoord(X3+Xc,Y3+Yc,Z3+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X3+Xc,Y3+Yc,Z3+Zc), stTextHeight);
|
||||||
QuadVertex(nq).SetNormal(X3/aRadius,Y3/aRadius,Z3/aRadius);
|
QuadVertex(nq).SetNormal(X3/aRadius,Y3/aRadius,Z3/aRadius);
|
||||||
QuadVertex(nq).SetTextureCoordinate(Tx2,Ty2);
|
QuadVertex(nq).SetTextureCoordinate(Tx2,Ty2);
|
||||||
QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE);
|
QuadEdge(nq).SetValues(nq,nq+1,Aspect_TOE_VISIBLE);
|
||||||
nq++;
|
nq++;
|
||||||
QuadVertex(nq).SetCoord(X4+Xc,Y4+Yc,Z4+Zc);
|
QuadVertex(nq).SetCoord(X4+Xc,Y4+Yc,Z4+Zc);
|
||||||
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
if(isText) aGroup->Text(stText,Graphic3d_Vertex(X4+Xc,Y4+Yc,Z4+Zc), stTextHeight);
|
||||||
QuadVertex(nq).SetNormal(X4/aRadius,Y4/aRadius,Z4/aRadius);
|
QuadVertex(nq).SetNormal(X4/aRadius,Y4/aRadius,Z4/aRadius);
|
||||||
QuadVertex(nq).SetTextureCoordinate(Tx2,Ty1);
|
QuadVertex(nq).SetTextureCoordinate(Tx2,Ty1);
|
||||||
QuadEdge(nq).SetValues(nq,nq-3,Aspect_TOE_VISIBLE);
|
QuadEdge(nq).SetValues(nq,nq-3,Aspect_TOE_VISIBLE);
|
||||||
@ -997,15 +997,15 @@ Sphere_Sphere::Sphere_Sphere(const gp_Pnt& aPosition,
|
|||||||
const Standard_Real aDeflection,
|
const Standard_Real aDeflection,
|
||||||
const Standard_Boolean hasVNormals,
|
const Standard_Boolean hasVNormals,
|
||||||
const Standard_Boolean hasVColors,
|
const Standard_Boolean hasVColors,
|
||||||
const Standard_Boolean hasVTexels,
|
const Standard_Boolean hasVTexels,
|
||||||
const Standard_Boolean hasText,
|
const Standard_Boolean hasText,
|
||||||
const Standard_Boolean isOptText
|
const Standard_Boolean isOptText
|
||||||
) :
|
) :
|
||||||
Sphere_BasicShape(BRepPrimAPI_MakeSphere(aRadius).Shape(),
|
Sphere_BasicShape(BRepPrimAPI_MakeSphere(aRadius).Shape(),
|
||||||
aDeflection,hasVNormals,hasVColors,hasVTexels),
|
aDeflection,hasVNormals,hasVColors,hasVTexels),
|
||||||
myRadius(aRadius),
|
myRadius(aRadius),
|
||||||
myText(hasText),
|
myText(hasText),
|
||||||
myOptText(isOptText)
|
myOptText(isOptText)
|
||||||
{
|
{
|
||||||
gp_Trsf trsf;
|
gp_Trsf trsf;
|
||||||
trsf.SetTranslation(gp_Vec(aPosition.X(),aPosition.Y(),aPosition.Z()));
|
trsf.SetTranslation(gp_Vec(aPosition.X(),aPosition.Y(),aPosition.Z()));
|
||||||
|
@ -69,10 +69,10 @@ Translate::~Translate()
|
|||||||
'filter'
|
'filter'
|
||||||
*/
|
*/
|
||||||
QString Translate::selectFileName( const QString& filter, bool isImport ) const
|
QString Translate::selectFileName( const QString& filter, bool isImport ) const
|
||||||
{
|
{
|
||||||
return isImport ?
|
return isImport ?
|
||||||
QFileDialog::getOpenFileName( QApplication::activeWindow(), tr("INF_APP_IMPORT"), QString::null, filter ) :
|
QFileDialog::getOpenFileName( QApplication::activeWindow(), tr("INF_APP_IMPORT"), QString::null, filter ) :
|
||||||
QFileDialog::getSaveFileName( QApplication::activeWindow(), tr("INF_APP_EXPORT"), QString::null, filter );
|
QFileDialog::getSaveFileName( QApplication::activeWindow(), tr("INF_APP_EXPORT"), QString::null, filter );
|
||||||
/*
|
/*
|
||||||
QFileDialog fd ( 0, 0, true );
|
QFileDialog fd ( 0, 0, true );
|
||||||
fd.setFilters( filter );
|
fd.setFilters( filter );
|
||||||
@ -82,7 +82,7 @@ QString Translate::selectFileName( const QString& filter, bool isImport ) const
|
|||||||
|
|
||||||
qApp->processEvents();
|
qApp->processEvents();
|
||||||
|
|
||||||
return ( ret == QDialog::Accepted ? fd.selectedFile() : QString::null );
|
return ( ret == QDialog::Accepted ? fd.selectedFile() : QString::null );
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
#include <qpainter.h>
|
#include <qpainter.h>
|
||||||
#include <qmenu.h>
|
#include <qmenu.h>
|
||||||
#include <qcolordialog.h>
|
#include <qcolordialog.h>
|
||||||
#include <qcursor.h>
|
#include <qcursor.h>
|
||||||
#include <qevent.h>
|
#include <qevent.h>
|
||||||
#include <qrubberband.h>
|
#include <qrubberband.h>
|
||||||
|
|
||||||
#include "View.h"
|
#include "View.h"
|
||||||
@ -58,12 +58,12 @@
|
|||||||
View::View( Handle(AIS_InteractiveContext) theContext, QWidget* parent, MDIWindow* mdi )
|
View::View( Handle(AIS_InteractiveContext) theContext, QWidget* parent, MDIWindow* mdi )
|
||||||
: QWidget( parent ), myMDI( mdi ), myRubberBand( 0 )
|
: QWidget( parent ), myMDI( mdi ), myRubberBand( 0 )
|
||||||
{
|
{
|
||||||
setBackgroundRole( QPalette::NoRole );//NoBackground );
|
setBackgroundRole( QPalette::NoRole );//NoBackground );
|
||||||
// set focus policy to threat QContextMenuEvent from keyboard
|
// set focus policy to threat QContextMenuEvent from keyboard
|
||||||
setFocusPolicy( Qt::StrongFocus );
|
setFocusPolicy( Qt::StrongFocus );
|
||||||
setAttribute( Qt::WA_PaintOnScreen );
|
setAttribute( Qt::WA_PaintOnScreen );
|
||||||
setAttribute( Qt::WA_NoSystemBackground );
|
setAttribute( Qt::WA_NoSystemBackground );
|
||||||
|
|
||||||
#ifndef WNT
|
#ifndef WNT
|
||||||
XSynchronize( x11Display(), true ); // it is possible to use QApplication::syncX();
|
XSynchronize( x11Display(), true ); // it is possible to use QApplication::syncX();
|
||||||
#endif
|
#endif
|
||||||
@ -88,17 +88,17 @@ View::View( Handle(AIS_InteractiveContext) theContext, QWidget* parent, MDIWindo
|
|||||||
*/
|
*/
|
||||||
Visual *v = DefaultVisual( x11Display(), DefaultScreen( x11Display() ) );
|
Visual *v = DefaultVisual( x11Display(), DefaultScreen( x11Display() ) );
|
||||||
int visualID = XVisualIDFromVisual( v );
|
int visualID = XVisualIDFromVisual( v );
|
||||||
|
|
||||||
/* Here we use the settings from
|
/* Here we use the settings from
|
||||||
Optimizer_ViewInfo::TxglCreateWindow()
|
Optimizer_ViewInfo::TxglCreateWindow()
|
||||||
*/
|
*/
|
||||||
int visualAttr[] = { GLX_RGBA, GLX_DEPTH_SIZE, 1,
|
int visualAttr[] = { GLX_RGBA, GLX_DEPTH_SIZE, 1,
|
||||||
GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1,
|
GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1,
|
||||||
GLX_BLUE_SIZE, 1, GLX_DOUBLEBUFFER,
|
GLX_BLUE_SIZE, 1, GLX_DOUBLEBUFFER,
|
||||||
None };
|
None };
|
||||||
pVisualInfo = ::glXChooseVisual (x11Display(), DefaultScreen(x11Display()), visualAttr);
|
pVisualInfo = ::glXChooseVisual (x11Display(), DefaultScreen(x11Display()), visualAttr);
|
||||||
|
|
||||||
if ( isVisible() )
|
if ( isVisible() )
|
||||||
hide();
|
hide();
|
||||||
|
|
||||||
XSetWindowAttributes a;
|
XSetWindowAttributes a;
|
||||||
@ -119,81 +119,81 @@ View::View( Handle(AIS_InteractiveContext) theContext, QWidget* parent, MDIWindo
|
|||||||
int count;
|
int count;
|
||||||
if ( XGetWMColormapWindows( x11Display(), topLevelWidget()->winId(),
|
if ( XGetWMColormapWindows( x11Display(), topLevelWidget()->winId(),
|
||||||
&cmwret, &count ) ) {
|
&cmwret, &count ) ) {
|
||||||
cmw = new Window[count+1];
|
cmw = new Window[count+1];
|
||||||
memcpy( (char *)cmw, (char *)cmwret, sizeof(Window)*count );
|
memcpy( (char *)cmw, (char *)cmwret, sizeof(Window)*count );
|
||||||
XFree( (char *)cmwret );
|
XFree( (char *)cmwret );
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
if ( cmw[i] == winId() ) { /* replace old window */
|
if ( cmw[i] == winId() ) { /* replace old window */
|
||||||
cmw[i] = w;
|
cmw[i] = w;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( i >= count ) /* append new window */
|
if ( i >= count ) /* append new window */
|
||||||
cmw[count++] = w;
|
cmw[count++] = w;
|
||||||
} else {
|
} else {
|
||||||
count = 1;
|
count = 1;
|
||||||
cmw = new Window[count];
|
cmw = new Window[count];
|
||||||
cmw[0] = w;
|
cmw[0] = w;
|
||||||
}
|
}
|
||||||
/* Creating new window (with good VisualID) for this widget */
|
/* Creating new window (with good VisualID) for this widget */
|
||||||
create( w );
|
create( w );
|
||||||
XSetWMColormapWindows( x11Display(), topLevelWidget()->winId(), cmw, count );
|
XSetWMColormapWindows( x11Display(), topLevelWidget()->winId(), cmw, count );
|
||||||
delete [] cmw;
|
delete [] cmw;
|
||||||
|
|
||||||
if ( isVisible() )
|
if ( isVisible() )
|
||||||
show();
|
show();
|
||||||
if ( pVisualInfo ) {
|
if ( pVisualInfo ) {
|
||||||
XFree( (char *)pVisualInfo );
|
XFree( (char *)pVisualInfo );
|
||||||
}
|
}
|
||||||
XFlush( x11Display() );
|
XFlush( x11Display() );
|
||||||
}
|
}
|
||||||
#endif // !defined WNT
|
#endif // !defined WNT
|
||||||
|
|
||||||
// will be set in OnInitial update, but, for more security :
|
// will be set in OnInitial update, but, for more security :
|
||||||
myCurrentMode = CurAction3d_Nothing;
|
myCurrentMode = CurAction3d_Nothing;
|
||||||
setMouseTracking( true );
|
setMouseTracking( true );
|
||||||
myView = NULL;
|
myView = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
View::~View()
|
View::~View()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void View::init()
|
void View::init()
|
||||||
{
|
{
|
||||||
myView = myContext->CurrentViewer()->CreateView();
|
myView = myContext->CurrentViewer()->CreateView();
|
||||||
int windowHandle = (int) winId();
|
int windowHandle = (int) winId();
|
||||||
short hi, lo;
|
short hi, lo;
|
||||||
lo = (short) windowHandle;
|
lo = (short) windowHandle;
|
||||||
hi = (short) ( windowHandle >> 16 );
|
hi = (short) ( windowHandle >> 16 );
|
||||||
#ifdef WNT
|
#ifdef WNT
|
||||||
Handle(WNT_Window) hWnd =
|
Handle(WNT_Window) hWnd =
|
||||||
new WNT_Window( Handle(Graphic3d_WNTGraphicDevice)::
|
new WNT_Window( Handle(Graphic3d_WNTGraphicDevice)::
|
||||||
DownCast( myContext->CurrentViewer()->Device() ) , (int) hi, (int) lo );
|
DownCast( myContext->CurrentViewer()->Device() ) , (int) hi, (int) lo );
|
||||||
#else
|
#else
|
||||||
Handle(Xw_Window) hWnd =
|
Handle(Xw_Window) hWnd =
|
||||||
new Xw_Window( Handle(Graphic3d_GraphicDevice)::
|
new Xw_Window( Handle(Graphic3d_GraphicDevice)::
|
||||||
DownCast( myContext->CurrentViewer()->Device() ),
|
DownCast( myContext->CurrentViewer()->Device() ),
|
||||||
(int) hi, (int) lo, Xw_WQ_SAMEQUALITY, Quantity_NOC_BLACK );
|
(int) hi, (int) lo, Xw_WQ_SAMEQUALITY, Quantity_NOC_BLACK );
|
||||||
#endif // WNT
|
#endif // WNT
|
||||||
myView->SetWindow( hWnd );
|
myView->SetWindow( hWnd );
|
||||||
if ( !hWnd->IsMapped() )
|
if ( !hWnd->IsMapped() )
|
||||||
hWnd->Map();
|
hWnd->Map();
|
||||||
myView->SetBackgroundColor(Quantity_NOC_GRAY40);
|
myView->SetBackgroundColor(Quantity_NOC_GRAY40);
|
||||||
myView->MustBeResized();
|
myView->MustBeResized();
|
||||||
|
|
||||||
Handle(Geom_Axis2Placement) anAxis = new Geom_Axis2Placement( gp::XOY() );
|
Handle(Geom_Axis2Placement) anAxis = new Geom_Axis2Placement( gp::XOY() );
|
||||||
myTrihedron = new AIS_Trihedron( anAxis );
|
myTrihedron = new AIS_Trihedron( anAxis );
|
||||||
myContext->Display( myTrihedron );
|
myContext->Display( myTrihedron );
|
||||||
|
|
||||||
//myView->SetAntialiasingOn();
|
//myView->SetAntialiasingOn();
|
||||||
myComputedModeIsOn = true;
|
myComputedModeIsOn = true;
|
||||||
myView->SetScale(3.0316);
|
myView->SetScale(3.0316);
|
||||||
|
|
||||||
// This is to update View properties dialog
|
// This is to update View properties dialog
|
||||||
emit ViewInitialized();
|
emit ViewInitialized();
|
||||||
}
|
}
|
||||||
|
|
||||||
void View::paintEvent ( QPaintEvent * e)
|
void View::paintEvent ( QPaintEvent * e)
|
||||||
{
|
{
|
||||||
@ -268,9 +268,9 @@ void View::onLButtonDown( Qt::KeyboardModifiers nFlags, const QPoint point )
|
|||||||
case CurAction3d_GlobalPanning :// noting
|
case CurAction3d_GlobalPanning :// noting
|
||||||
break;
|
break;
|
||||||
case CurAction3d_DynamicRotation :
|
case CurAction3d_DynamicRotation :
|
||||||
if (!myComputedModeIsOn){
|
if (!myComputedModeIsOn){
|
||||||
myView->SetComputedMode(false);
|
myView->SetComputedMode(false);
|
||||||
}
|
}
|
||||||
myView->SetAnimationModeOn();
|
myView->SetAnimationModeOn();
|
||||||
myView->StartRotation(point.x(),point.y());
|
myView->StartRotation(point.x(),point.y());
|
||||||
break;
|
break;
|
||||||
@ -283,15 +283,15 @@ void View::onLButtonDown( Qt::KeyboardModifiers nFlags, const QPoint point )
|
|||||||
|
|
||||||
void View::onRButtonDown( Qt::KeyboardModifiers nFlags, const QPoint point )
|
void View::onRButtonDown( Qt::KeyboardModifiers nFlags, const QPoint point )
|
||||||
{
|
{
|
||||||
if ( nFlags == CASCADESHORTCUTKEY ) {
|
if ( nFlags == CASCADESHORTCUTKEY ) {
|
||||||
if ( !myComputedModeIsOn )
|
if ( !myComputedModeIsOn )
|
||||||
myView->SetComputedMode(false);
|
myView->SetComputedMode(false);
|
||||||
// Standard_Boolean anim, deg;
|
// Standard_Boolean anim, deg;
|
||||||
// anim = myView->AnimationMode( deg );
|
// anim = myView->AnimationMode( deg );
|
||||||
// if ( anim /*&& deg*/ ) {
|
// if ( anim /*&& deg*/ ) {
|
||||||
myCycleCounter = 0;
|
myCycleCounter = 0;
|
||||||
Application::startTimer();
|
Application::startTimer();
|
||||||
myView->SetAnimationModeOn();
|
myView->SetAnimationModeOn();
|
||||||
// myView->SetAnimationMode(true,true);
|
// myView->SetAnimationMode(true,true);
|
||||||
// myContext->DeactivateStandardMode( TopAbs_SHAPE );
|
// myContext->DeactivateStandardMode( TopAbs_SHAPE );
|
||||||
// }
|
// }
|
||||||
@ -366,7 +366,7 @@ void View::onLButtonUp(Qt::KeyboardModifiers nFlags, const QPoint point)
|
|||||||
emit noActiveActions();
|
emit noActiveActions();
|
||||||
break;
|
break;
|
||||||
case CurAction3d_DynamicRotation :
|
case CurAction3d_DynamicRotation :
|
||||||
myCurrentMode = CurAction3d_Nothing;
|
myCurrentMode = CurAction3d_Nothing;
|
||||||
myView->SetAnimationModeOff();
|
myView->SetAnimationModeOff();
|
||||||
emit noActiveActions();
|
emit noActiveActions();
|
||||||
break;
|
break;
|
||||||
@ -382,16 +382,16 @@ void View::onRButtonUp(Qt::KeyboardModifiers nFlags, const QPoint point)
|
|||||||
QApplication::setOverrideCursor( Qt::WaitCursor );
|
QApplication::setOverrideCursor( Qt::WaitCursor );
|
||||||
// reset computed mode according to the stored one
|
// reset computed mode according to the stored one
|
||||||
// --> dynamic rotation may have change it
|
// --> dynamic rotation may have change it
|
||||||
|
|
||||||
if (!myComputedModeIsOn)
|
if (!myComputedModeIsOn)
|
||||||
{
|
{
|
||||||
myView->SetComputedMode(false);
|
myView->SetComputedMode(false);
|
||||||
myComputedModeIsOn = Standard_False;
|
myComputedModeIsOn = Standard_False;
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
myView->SetComputedMode(false);
|
myView->SetComputedMode(false);
|
||||||
myComputedModeIsOn = Standard_True;
|
myComputedModeIsOn = Standard_True;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if ( myView->AnimationModeIsOn() ) {
|
//if ( myView->AnimationModeIsOn() ) {
|
||||||
myView->SetAnimationModeOff();
|
myView->SetAnimationModeOff();
|
||||||
@ -555,83 +555,83 @@ void View::Popup()
|
|||||||
{
|
{
|
||||||
QMenu* popMenu = new QMenu( this );
|
QMenu* popMenu = new QMenu( this );
|
||||||
|
|
||||||
if( myContext->NbCurrents()) {
|
if( myContext->NbCurrents()) {
|
||||||
QAction* a;
|
QAction* a;
|
||||||
myContext->InitCurrent();
|
myContext->InitCurrent();
|
||||||
if (! myContext->Current()->IsKind(STANDARD_TYPE(AIS_Trihedron)))
|
if (! myContext->Current()->IsKind(STANDARD_TYPE(AIS_Trihedron)))
|
||||||
{
|
{
|
||||||
a = new QAction( tr( "MEN_POP_OBJPROP" ), this );
|
a = new QAction( tr( "MEN_POP_OBJPROP" ), this );
|
||||||
verify( connect( a, SIGNAL( activated() ), SLOT( onEditObjectProperties() ) ) );
|
verify( connect( a, SIGNAL( activated() ), SLOT( onEditObjectProperties() ) ) );
|
||||||
popMenu->addAction( a );
|
popMenu->addAction( a );
|
||||||
|
|
||||||
QMenu* dMode = popMenu->addMenu( tr( "MEN_POP_DISPLAYMODE" ) );
|
QMenu* dMode = popMenu->addMenu( tr( "MEN_POP_DISPLAYMODE" ) );
|
||||||
|
|
||||||
a = new QAction( tr( "MEN_POP_WIREFRAME" ), this );
|
a = new QAction( tr( "MEN_POP_WIREFRAME" ), this );
|
||||||
verify( connect( a, SIGNAL( activated() ), SLOT( onWireframeMode() ) ) );
|
verify( connect( a, SIGNAL( activated() ), SLOT( onWireframeMode() ) ) );
|
||||||
dMode->addAction( a );
|
dMode->addAction( a );
|
||||||
|
|
||||||
a = new QAction( tr( "MEN_POP_SHADING" ), this );
|
a = new QAction( tr( "MEN_POP_SHADING" ), this );
|
||||||
verify( connect( a, SIGNAL( activated() ), SLOT( onShadingMode() ) ) );
|
verify( connect( a, SIGNAL( activated() ), SLOT( onShadingMode() ) ) );
|
||||||
dMode->addAction( a );
|
dMode->addAction( a );
|
||||||
}
|
}
|
||||||
a = new QAction( tr( "MEN_POP_REMOVEOBJECT" ), this );
|
a = new QAction( tr( "MEN_POP_REMOVEOBJECT" ), this );
|
||||||
verify( connect( a, SIGNAL( activated() ), SLOT( onRemoveObject() ) ) );
|
verify( connect( a, SIGNAL( activated() ), SLOT( onRemoveObject() ) ) );
|
||||||
popMenu->addAction( a );
|
popMenu->addAction( a );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
QAction* a = new QAction( tr( "MEN_POP_VIEWPROP" ), this );
|
QAction* a = new QAction( tr( "MEN_POP_VIEWPROP" ), this );
|
||||||
verify( connect( a, SIGNAL( activated() ), Application::getApplication(), SLOT( onEditViewProperties() ) ) );
|
verify( connect( a, SIGNAL( activated() ), Application::getApplication(), SLOT( onEditViewProperties() ) ) );
|
||||||
popMenu->addAction( a );
|
popMenu->addAction( a );
|
||||||
|
|
||||||
a = new QAction( tr( "MEN_POP_IMPORT" ), this );
|
a = new QAction( tr( "MEN_POP_IMPORT" ), this );
|
||||||
verify( connect( a, SIGNAL( activated() ), SLOT( onImportObject() ) ) );
|
verify( connect( a, SIGNAL( activated() ), SLOT( onImportObject() ) ) );
|
||||||
popMenu->addAction( a );
|
popMenu->addAction( a );
|
||||||
|
|
||||||
popMenu->addSeparator();
|
popMenu->addSeparator();
|
||||||
if ( myContext->IsDisplayed( myTrihedron ) ) {
|
if ( myContext->IsDisplayed( myTrihedron ) ) {
|
||||||
a = new QAction( tr( "MEN_POP_ERASETRIHEDRON" ), this );
|
a = new QAction( tr( "MEN_POP_ERASETRIHEDRON" ), this );
|
||||||
verify( connect( a, SIGNAL( activated() ), SLOT( onEraseTrihedron() ) ) );
|
verify( connect( a, SIGNAL( activated() ), SLOT( onEraseTrihedron() ) ) );
|
||||||
popMenu->addAction( a );
|
popMenu->addAction( a );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
a = new QAction( tr( "MEN_POP_DISPLAYTRIHEDRON" ), this );
|
a = new QAction( tr( "MEN_POP_DISPLAYTRIHEDRON" ), this );
|
||||||
verify( connect( a, SIGNAL( activated() ), SLOT( onDisplayTrihedron() ) ) );
|
verify( connect( a, SIGNAL( activated() ), SLOT( onDisplayTrihedron() ) ) );
|
||||||
popMenu->addAction( a );
|
popMenu->addAction( a );
|
||||||
}
|
}
|
||||||
|
|
||||||
popMenu->addSeparator();
|
popMenu->addSeparator();
|
||||||
a = new QAction( tr( "MEN_POP_CREATESHAPE" ), this );
|
a = new QAction( tr( "MEN_POP_CREATESHAPE" ), this );
|
||||||
verify( connect( a, SIGNAL( activated() ), SLOT( onCreateShape() ) ) );
|
verify( connect( a, SIGNAL( activated() ), SLOT( onCreateShape() ) ) );
|
||||||
popMenu->addAction( a );
|
popMenu->addAction( a );
|
||||||
|
|
||||||
QMenu* loadObj = popMenu->addMenu( tr( "MEN_POP_LOADOBJECT" ) );
|
QMenu* loadObj = popMenu->addMenu( tr( "MEN_POP_LOADOBJECT" ) );
|
||||||
|
|
||||||
a = new QAction( tr( "MEN_POP_BOX" ), this );
|
a = new QAction( tr( "MEN_POP_BOX" ), this );
|
||||||
verify( connect( a, SIGNAL( activated() ), SLOT( onLoadBox() ) ) );
|
verify( connect( a, SIGNAL( activated() ), SLOT( onLoadBox() ) ) );
|
||||||
loadObj->addAction( a );
|
loadObj->addAction( a );
|
||||||
|
|
||||||
a = new QAction( tr( "MEN_POP_SPHERE" ), this );
|
a = new QAction( tr( "MEN_POP_SPHERE" ), this );
|
||||||
verify( connect( a, SIGNAL( activated() ), SLOT( onLoadSphere() ) ) );
|
verify( connect( a, SIGNAL( activated() ), SLOT( onLoadSphere() ) ) );
|
||||||
loadObj->addAction( a );
|
loadObj->addAction( a );
|
||||||
|
|
||||||
a = new QAction( tr( "MEN_POP_TORUS" ), this );
|
a = new QAction( tr( "MEN_POP_TORUS" ), this );
|
||||||
verify( connect( a, SIGNAL( activated() ), SLOT( onLoadTorus() ) ) );
|
verify( connect( a, SIGNAL( activated() ), SLOT( onLoadTorus() ) ) );
|
||||||
loadObj->addAction( a );
|
loadObj->addAction( a );
|
||||||
|
|
||||||
// a = new QAction( tr( "MEN_POP_LINE" ), this );
|
// a = new QAction( tr( "MEN_POP_LINE" ), this );
|
||||||
// verify( connect( a, SIGNAL( activated() ), SLOT( onLoadLine() ) ) );
|
// verify( connect( a, SIGNAL( activated() ), SLOT( onLoadLine() ) ) );
|
||||||
// loadObj->addAction( a );
|
// loadObj->addAction( a );
|
||||||
}
|
}
|
||||||
popMenu->exec( QCursor::pos() );
|
popMenu->exec( QCursor::pos() );
|
||||||
}
|
}
|
||||||
|
|
||||||
void View::DrawRectangle( int MinX, int MinY, int MaxX, int MaxY, bool Draw )
|
void View::DrawRectangle( int MinX, int MinY, int MaxX, int MaxY, bool Draw )
|
||||||
{
|
{
|
||||||
if ( !myRubberBand )
|
if ( !myRubberBand )
|
||||||
myRubberBand = new QRubberBand( QRubberBand::Rectangle, this );
|
myRubberBand = new QRubberBand( QRubberBand::Rectangle, this );
|
||||||
|
|
||||||
myRubberBand->setGeometry( QRect( QPoint( MinX, MinY ), QPoint( MaxX, MaxY ) ).normalized() );
|
myRubberBand->setGeometry( QRect( QPoint( MinX, MinY ), QPoint( MaxX, MaxY ) ).normalized() );
|
||||||
myRubberBand->setVisible( Draw );
|
myRubberBand->setVisible( Draw );
|
||||||
/*
|
/*
|
||||||
QPainter thePainter(this);
|
QPainter thePainter(this);
|
||||||
thePainter.setRasterOp(Qt::XorROP);
|
thePainter.setRasterOp(Qt::XorROP);
|
||||||
@ -658,7 +658,7 @@ void View::DrawRectangle( int MinX, int MinY, int MaxX, int MaxY, bool Draw )
|
|||||||
thePainter.drawRect(aRect);
|
thePainter.drawRect(aRect);
|
||||||
m_IsVisible = true;
|
m_IsVisible = true;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void View::onImportObject()
|
void View::onImportObject()
|
||||||
@ -756,7 +756,7 @@ void View::startAction( ViewOperations::Action action )
|
|||||||
}
|
}
|
||||||
|
|
||||||
void View::onCreateShape()
|
void View::onCreateShape()
|
||||||
{
|
{
|
||||||
myView->SetScale(3.0316);
|
myView->SetScale(3.0316);
|
||||||
if ( !myShapeDlg )
|
if ( !myShapeDlg )
|
||||||
myShapeDlg = new ShapeDlg( Application::getApplication(), myView, myContext );
|
myShapeDlg = new ShapeDlg( Application::getApplication(), myView, myContext );
|
||||||
@ -764,7 +764,7 @@ void View::onCreateShape()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void View::onLoadBox()
|
void View::onLoadBox()
|
||||||
{
|
{
|
||||||
myView->SetScale(1.0);
|
myView->SetScale(1.0);
|
||||||
Standard_Real size = myContext->CurrentViewer()->DefaultViewSize() / 4.;
|
Standard_Real size = myContext->CurrentViewer()->DefaultViewSize() / 4.;
|
||||||
gp_Pnt origin( -size / 2., -size / 2., -size / 2. );
|
gp_Pnt origin( -size / 2., -size / 2., -size / 2. );
|
||||||
@ -783,7 +783,7 @@ void View::onLoadBox()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void View::onLoadSphere()
|
void View::onLoadSphere()
|
||||||
{
|
{
|
||||||
myView->SetScale(1.0);
|
myView->SetScale(1.0);
|
||||||
Standard_Real radius = myContext->CurrentViewer()->DefaultViewSize() / 4.;
|
Standard_Real radius = myContext->CurrentViewer()->DefaultViewSize() / 4.;
|
||||||
Handle(AIS_Shape) sphere =
|
Handle(AIS_Shape) sphere =
|
||||||
@ -801,7 +801,7 @@ void View::onLoadSphere()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void View::onLoadTorus()
|
void View::onLoadTorus()
|
||||||
{
|
{
|
||||||
myView->SetScale(1.0);
|
myView->SetScale(1.0);
|
||||||
Handle(V3d_Viewer) viewer = myContext->CurrentViewer();
|
Handle(V3d_Viewer) viewer = myContext->CurrentViewer();
|
||||||
Standard_Real r1 = viewer->DefaultViewSize() / 3.;
|
Standard_Real r1 = viewer->DefaultViewSize() / 3.;
|
||||||
@ -820,7 +820,7 @@ void View::onLoadTorus()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void View::onLoadLine()
|
void View::onLoadLine()
|
||||||
{
|
{
|
||||||
myView->SetScale(1.0);
|
myView->SetScale(1.0);
|
||||||
Handle(AIS_Line) line =
|
Handle(AIS_Line) line =
|
||||||
new AIS_Line( new Geom_Line( gp_Pnt( 0, 0, 0), gp_Dir( 0, 0, 1) ) );
|
new AIS_Line( new Geom_Line( gp_Pnt( 0, 0, 0), gp_Dir( 0, 0, 1) ) );
|
||||||
@ -857,18 +857,18 @@ void View::onWireframeMode()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void View::onShadingMode()
|
void View::onShadingMode()
|
||||||
{
|
{
|
||||||
|
|
||||||
myContext->InitSelected();
|
myContext->InitSelected();
|
||||||
for( ; myContext->MoreSelected(); myContext->NextSelected() ) {
|
for( ; myContext->MoreSelected(); myContext->NextSelected() ) {
|
||||||
Handle(AIS_InteractiveObject) obj = myContext->SelectedInteractive();
|
Handle(AIS_InteractiveObject) obj = myContext->SelectedInteractive();
|
||||||
//myContext->Erase( obj, false );
|
//myContext->Erase( obj, false );
|
||||||
//myContext->Display( obj /*, 1, 0*/, false );
|
//myContext->Display( obj /*, 1, 0*/, false );
|
||||||
//myContext->Activate( obj, 0 );
|
//myContext->Activate( obj, 0 );
|
||||||
myContext->SetDisplayMode( obj, 1 );
|
myContext->SetDisplayMode( obj, 1 );
|
||||||
}
|
}
|
||||||
myContext->UpdateCurrentViewer();
|
myContext->UpdateCurrentViewer();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void View::onDisplayTrihedron()
|
void View::onDisplayTrihedron()
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
#include <qcombobox.h>
|
#include <qcombobox.h>
|
||||||
|
|
||||||
#include <V3d_TypeOfVisualization.hxx>
|
#include <V3d_TypeOfVisualization.hxx>
|
||||||
|
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
#include "ViewDlg.h"
|
#include "ViewDlg.h"
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
@ -22,7 +22,7 @@
|
|||||||
ViewDlg::ViewDlg( QWidget* parent/*, Handle(V3d_View)& view*/ )
|
ViewDlg::ViewDlg( QWidget* parent/*, Handle(V3d_View)& view*/ )
|
||||||
:QDialog( parent ),
|
:QDialog( parent ),
|
||||||
myAutoApply( true ), /*myView( view ),*/ myApplyAllViews(false)
|
myAutoApply( true ), /*myView( view ),*/ myApplyAllViews(false)
|
||||||
{
|
{
|
||||||
setModal( false );
|
setModal( false );
|
||||||
setWindowTitle( tr( "TITLE_VIEW_DLG" ) );
|
setWindowTitle( tr( "TITLE_VIEW_DLG" ) );
|
||||||
|
|
||||||
@ -35,15 +35,15 @@ ViewDlg::ViewDlg( QWidget* parent/*, Handle(V3d_View)& view*/ )
|
|||||||
topLayout->addSpacing( 10 );
|
topLayout->addSpacing( 10 );
|
||||||
|
|
||||||
// view properties
|
// view properties
|
||||||
QGridLayout* pLayout = new QGridLayout( mainFrame );
|
QGridLayout* pLayout = new QGridLayout( mainFrame );
|
||||||
pLayout->setMargin( 5 );
|
pLayout->setMargin( 5 );
|
||||||
myZBufferBox = new QCheckBox( mainFrame );;
|
myZBufferBox = new QCheckBox( mainFrame );;
|
||||||
myZBufferBox->setText( tr( "BTN_ZBUFFER" ) );
|
myZBufferBox->setText( tr( "BTN_ZBUFFER" ) );
|
||||||
verify( connect( myZBufferBox, SIGNAL( toggled( bool ) ), SLOT( onZBuffer( bool ) ) ) );
|
verify( connect( myZBufferBox, SIGNAL( toggled( bool ) ), SLOT( onZBuffer( bool ) ) ) );
|
||||||
|
|
||||||
myAnimBox = new QCheckBox( mainFrame );
|
myAnimBox = new QCheckBox( mainFrame );
|
||||||
myAnimBox->setText( tr( "BTN_ANIMATION" ) );
|
myAnimBox->setText( tr( "BTN_ANIMATION" ) );
|
||||||
verify( connect( myAnimBox, SIGNAL( toggled( bool ) ), SLOT( onAnimation( bool ) ) ) );
|
verify( connect( myAnimBox, SIGNAL( toggled( bool ) ), SLOT( onAnimation( bool ) ) ) );
|
||||||
|
|
||||||
myDegBox = new QCheckBox( mainFrame );
|
myDegBox = new QCheckBox( mainFrame );
|
||||||
myDegBox->setText( tr( "BTN_DEGENERATION" ) );
|
myDegBox->setText( tr( "BTN_DEGENERATION" ) );
|
||||||
@ -53,7 +53,7 @@ ViewDlg::ViewDlg( QWidget* parent/*, Handle(V3d_View)& view*/ )
|
|||||||
pLayout->addWidget( myAnimBox, 1, 0 );
|
pLayout->addWidget( myAnimBox, 1, 0 );
|
||||||
pLayout->addWidget( myDegBox, 2, 0 );
|
pLayout->addWidget( myDegBox, 2, 0 );
|
||||||
pLayout->setRowStretch( 3, 10 );
|
pLayout->setRowStretch( 3, 10 );
|
||||||
pLayout->setColumnStretch( 1, 10 );
|
pLayout->setColumnStretch( 1, 10 );
|
||||||
|
|
||||||
// apply controls
|
// apply controls
|
||||||
QCheckBox *autoApply, *applyAllViews;
|
QCheckBox *autoApply, *applyAllViews;
|
||||||
@ -69,39 +69,39 @@ ViewDlg::ViewDlg( QWidget* parent/*, Handle(V3d_View)& view*/ )
|
|||||||
QHBoxLayout* applyLayout = new QHBoxLayout();
|
QHBoxLayout* applyLayout = new QHBoxLayout();
|
||||||
applyLayout->addWidget( autoApply );
|
applyLayout->addWidget( autoApply );
|
||||||
applyLayout->addStretch( 10 );
|
applyLayout->addStretch( 10 );
|
||||||
applyLayout->addWidget( applyAllViews );
|
applyLayout->addWidget( applyAllViews );
|
||||||
topLayout->addLayout( applyLayout );
|
topLayout->addLayout( applyLayout );
|
||||||
topLayout->addSpacing( 10 );
|
topLayout->addSpacing( 10 );
|
||||||
|
|
||||||
// control buttons
|
// control buttons
|
||||||
QPushButton *bOk, *bCancel/*, *bHelp*/;
|
QPushButton *bOk, *bCancel/*, *bHelp*/;
|
||||||
|
|
||||||
bOk = new QPushButton( tr( "BTN_OK" ), this );
|
bOk = new QPushButton( tr( "BTN_OK" ), this );
|
||||||
verify( connect( bOk, SIGNAL( clicked() ), SLOT( onOk() ) ) );
|
verify( connect( bOk, SIGNAL( clicked() ), SLOT( onOk() ) ) );
|
||||||
bOk->setDefault(true);
|
bOk->setDefault(true);
|
||||||
bCancel = new QPushButton( tr( "BTN_CANCEL" ), this );
|
bCancel = new QPushButton( tr( "BTN_CANCEL" ), this );
|
||||||
verify( connect( bCancel, SIGNAL( clicked() ), SLOT( onCancel() ) ) );
|
verify( connect( bCancel, SIGNAL( clicked() ), SLOT( onCancel() ) ) );
|
||||||
|
|
||||||
|
|
||||||
// bHelp = new QPushButton( tr( "BTN_HELP" ), this );
|
|
||||||
// verify( connect( bHelp, SIGNAL( clicked() ), SLOT( onHelp() ) ) );
|
// bHelp = new QPushButton( tr( "BTN_HELP" ), this );
|
||||||
|
// verify( connect( bHelp, SIGNAL( clicked() ), SLOT( onHelp() ) ) );
|
||||||
|
|
||||||
QHBoxLayout* btnLayout = new QHBoxLayout();
|
QHBoxLayout* btnLayout = new QHBoxLayout();
|
||||||
btnLayout->setSpacing( 5 );
|
btnLayout->setSpacing( 5 );
|
||||||
btnLayout->addStretch( 10 );
|
btnLayout->addStretch( 10 );
|
||||||
btnLayout->addWidget( bOk );
|
btnLayout->addWidget( bOk );
|
||||||
btnLayout->addWidget( bCancel );
|
btnLayout->addWidget( bCancel );
|
||||||
btnLayout->addStretch( 10 );
|
btnLayout->addStretch( 10 );
|
||||||
// btnLayout->addWidget( bHelp );
|
// btnLayout->addWidget( bHelp );
|
||||||
topLayout->addLayout( btnLayout );
|
topLayout->addLayout( btnLayout );
|
||||||
|
|
||||||
QSize s = topLayout->totalMinimumSize();
|
QSize s = topLayout->totalMinimumSize();
|
||||||
s.setWidth( s.width() + topLayout->margin() + 10 );
|
s.setWidth( s.width() + topLayout->margin() + 10 );
|
||||||
s.setHeight( s.height() + topLayout->margin() + 10 );
|
s.setHeight( s.height() + topLayout->margin() + 10 );
|
||||||
setFixedSize( s );
|
setFixedSize( s );
|
||||||
|
|
||||||
Handle(V3d_View) aView = Application::getApplication()->getActiveMDI()->getView();
|
Handle(V3d_View) aView = Application::getApplication()->getActiveMDI()->getView();
|
||||||
myIsAnim = aView->AnimationMode(myIsDeg);
|
myIsAnim = aView->AnimationMode(myIsDeg);
|
||||||
}
|
}
|
||||||
|
|
||||||
ViewDlg::~ViewDlg()
|
ViewDlg::~ViewDlg()
|
||||||
@ -109,20 +109,20 @@ ViewDlg::~ViewDlg()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ViewDlg::showEvent ( QShowEvent* e )
|
void ViewDlg::showEvent ( QShowEvent* e )
|
||||||
{
|
{
|
||||||
Update();
|
Update();
|
||||||
QWidget::showEvent( e );
|
QWidget::showEvent( e );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewDlg::onOk()
|
void ViewDlg::onOk()
|
||||||
{
|
{
|
||||||
hide();
|
hide();
|
||||||
bool Auto = myAutoApply;
|
bool Auto = myAutoApply;
|
||||||
|
|
||||||
myAutoApply = true;
|
myAutoApply = true;
|
||||||
onZBuffer(myZBufferBox->isChecked());
|
onZBuffer(myZBufferBox->isChecked());
|
||||||
onAnimation(myAnimBox->isChecked());
|
onAnimation(myAnimBox->isChecked());
|
||||||
onDegeneration(myDegBox->isChecked());
|
onDegeneration(myDegBox->isChecked());
|
||||||
myAutoApply = Auto;
|
myAutoApply = Auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,83 +130,83 @@ void ViewDlg::onCancel()
|
|||||||
{
|
{
|
||||||
hide();
|
hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewDlg::onHelp()
|
void ViewDlg::onHelp()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewDlg::onZBuffer( bool on )
|
void ViewDlg::onZBuffer( bool on )
|
||||||
{
|
{
|
||||||
QWidgetList aWidgetList;
|
QWidgetList aWidgetList;
|
||||||
Handle(V3d_View) aView;
|
Handle(V3d_View) aView;
|
||||||
QWidget* aWidget;
|
QWidget* aWidget;
|
||||||
|
|
||||||
if (!myApplyAllViews)
|
if (!myApplyAllViews)
|
||||||
aWidgetList.append(Application::getApplication()->getActiveMDI());
|
aWidgetList.append(Application::getApplication()->getActiveMDI());
|
||||||
else
|
else
|
||||||
aWidgetList = Application::getWorkspace()->windowList();
|
aWidgetList = Application::getWorkspace()->windowList();
|
||||||
|
|
||||||
if ( myAutoApply ){
|
if ( myAutoApply ){
|
||||||
foreach(aWidget, aWidgetList){
|
foreach(aWidget, aWidgetList){
|
||||||
if ( !aWidget ) continue;
|
if ( !aWidget ) continue;
|
||||||
MDIWindow* aMDIWindow = (MDIWindow*)aWidget;
|
MDIWindow* aMDIWindow = (MDIWindow*)aWidget;
|
||||||
aView = aMDIWindow->getView();
|
aView = aMDIWindow->getView();
|
||||||
if ( on )
|
if ( on )
|
||||||
aView->SetVisualization( V3d_ZBUFFER );
|
aView->SetVisualization( V3d_ZBUFFER );
|
||||||
else
|
else
|
||||||
aView->SetVisualization( V3d_WIREFRAME );
|
aView->SetVisualization( V3d_WIREFRAME );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewDlg::onAnimation( bool on )
|
void ViewDlg::onAnimation( bool on )
|
||||||
{
|
{
|
||||||
QWidgetList aWidgetList;
|
QWidgetList aWidgetList;
|
||||||
Handle(V3d_View) aView;
|
Handle(V3d_View) aView;
|
||||||
|
|
||||||
myIsAnim = on;
|
myIsAnim = on;
|
||||||
myDegBox->setEnabled( myIsAnim );
|
myDegBox->setEnabled( myIsAnim );
|
||||||
if (!myIsAnim) myDegBox->setChecked(false);
|
if (!myIsAnim) myDegBox->setChecked(false);
|
||||||
|
|
||||||
if (!myApplyAllViews)
|
if (!myApplyAllViews)
|
||||||
aWidgetList.append(Application::getApplication()->getActiveMDI());
|
aWidgetList.append(Application::getApplication()->getActiveMDI());
|
||||||
else
|
else
|
||||||
aWidgetList = Application::getWorkspace()->windowList();
|
aWidgetList = Application::getWorkspace()->windowList();
|
||||||
|
|
||||||
if ( myAutoApply ){
|
if ( myAutoApply ){
|
||||||
QWidget* aWidget;
|
QWidget* aWidget;
|
||||||
foreach(aWidget, aWidgetList){
|
foreach(aWidget, aWidgetList){
|
||||||
if ( !aWidget ) continue;
|
if ( !aWidget ) continue;
|
||||||
MDIWindow* aMDIWindow = (MDIWindow*)aWidget;
|
MDIWindow* aMDIWindow = (MDIWindow*)aWidget;
|
||||||
aView = aMDIWindow->getView();
|
aView = aMDIWindow->getView();
|
||||||
aView->SetAnimationMode( myIsAnim, myIsDeg );
|
aView->SetAnimationMode( myIsAnim, myIsDeg );
|
||||||
aView->Redraw();
|
aView->Redraw();
|
||||||
aView->SetImmediateUpdate(true);
|
aView->SetImmediateUpdate(true);
|
||||||
aView->Update();
|
aView->Update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewDlg::onDegeneration( bool on )
|
void ViewDlg::onDegeneration( bool on )
|
||||||
{
|
{
|
||||||
QWidgetList aWidgetList;
|
QWidgetList aWidgetList;
|
||||||
Handle(V3d_View) aView;
|
Handle(V3d_View) aView;
|
||||||
QWidget* aWidget;
|
QWidget* aWidget;
|
||||||
|
|
||||||
if (!myApplyAllViews)
|
if (!myApplyAllViews)
|
||||||
aWidgetList.append(Application::getApplication()->getActiveMDI());
|
aWidgetList.append(Application::getApplication()->getActiveMDI());
|
||||||
else
|
else
|
||||||
aWidgetList = Application::getWorkspace()->windowList();
|
aWidgetList = Application::getWorkspace()->windowList();
|
||||||
|
|
||||||
|
|
||||||
myIsDeg = on;
|
myIsDeg = on;
|
||||||
if ( myAutoApply ){
|
if ( myAutoApply ){
|
||||||
foreach(aWidget, aWidgetList){
|
foreach(aWidget, aWidgetList){
|
||||||
if ( !aWidget ) continue;
|
if ( !aWidget ) continue;
|
||||||
MDIWindow* aMDIWindow = (MDIWindow*)aWidget;
|
MDIWindow* aMDIWindow = (MDIWindow*)aWidget;
|
||||||
aView = aMDIWindow->getView();
|
aView = aMDIWindow->getView();
|
||||||
aView->SetAnimationMode( myIsAnim, myIsDeg );
|
aView->SetAnimationMode( myIsAnim, myIsDeg );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -216,33 +216,33 @@ void ViewDlg::onAutoApply( bool on )
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ViewDlg::onApplyAllViews( bool on )
|
void ViewDlg::onApplyAllViews( bool on )
|
||||||
{
|
{
|
||||||
myApplyAllViews = on;
|
myApplyAllViews = on;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewDlg::Update()
|
void ViewDlg::Update()
|
||||||
{
|
{
|
||||||
MDIWindow* anActiveMDIWindow = Application::getApplication()->getActiveMDI();
|
MDIWindow* anActiveMDIWindow = Application::getApplication()->getActiveMDI();
|
||||||
if (anActiveMDIWindow){
|
if (anActiveMDIWindow){
|
||||||
Handle(V3d_View) aView = anActiveMDIWindow->getView();
|
Handle(V3d_View) aView = anActiveMDIWindow->getView();
|
||||||
if(!aView.IsNull()){
|
if(!aView.IsNull()){
|
||||||
|
|
||||||
myIsAnim = aView->AnimationMode( myIsDeg );
|
myIsAnim = aView->AnimationMode( myIsDeg );
|
||||||
myAnimBox->blockSignals( true );
|
myAnimBox->blockSignals( true );
|
||||||
myDegBox->blockSignals( true );
|
myDegBox->blockSignals( true );
|
||||||
myAnimBox->setChecked( myIsAnim );
|
myAnimBox->setChecked( myIsAnim );
|
||||||
myDegBox->setChecked( myIsDeg );
|
myDegBox->setChecked( myIsDeg );
|
||||||
myDegBox->setEnabled( myIsAnim );
|
myDegBox->setEnabled( myIsAnim );
|
||||||
myAnimBox->blockSignals( false );
|
myAnimBox->blockSignals( false );
|
||||||
myDegBox->blockSignals( false );
|
myDegBox->blockSignals( false );
|
||||||
|
|
||||||
myZBufferBox->blockSignals(true);
|
myZBufferBox->blockSignals(true);
|
||||||
V3d_TypeOfVisualization aVisuType = aView->Visualization();
|
V3d_TypeOfVisualization aVisuType = aView->Visualization();
|
||||||
if(aVisuType == V3d_WIREFRAME)
|
if(aVisuType == V3d_WIREFRAME)
|
||||||
myZBufferBox -> setChecked(false);
|
myZBufferBox -> setChecked(false);
|
||||||
else
|
else
|
||||||
myZBufferBox -> setChecked(true);
|
myZBufferBox -> setChecked(true);
|
||||||
myZBufferBox->blockSignals(false);
|
myZBufferBox->blockSignals(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -106,90 +106,90 @@ QList<QAction*> ViewOperations::getViewActions()
|
|||||||
|
|
||||||
void ViewOperations::initViewActions()
|
void ViewOperations::initViewActions()
|
||||||
{
|
{
|
||||||
if ( myViewActions.count() )
|
if ( myViewActions.count() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QString dir = Application::getResourceDir();
|
QString dir = Application::getResourceDir();
|
||||||
|
|
||||||
QAction* a;
|
QAction* a;
|
||||||
|
|
||||||
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_FITALL" ) ), "", this );
|
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_FITALL" ) ), "", this );
|
||||||
a->setToolTip( tr( "TBR_FITALL" ) );
|
a->setToolTip( tr( "TBR_FITALL" ) );
|
||||||
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
|
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
|
||||||
myViewActions.insert( ViewFitAllId, a );
|
myViewActions.insert( ViewFitAllId, a );
|
||||||
|
|
||||||
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_FITAREA" ) ), "", this );
|
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_FITAREA" ) ), "", this );
|
||||||
a->setToolTip( tr( "TBR_FITAREA" ) );
|
a->setToolTip( tr( "TBR_FITAREA" ) );
|
||||||
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
|
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
|
||||||
a->setCheckable( true );
|
a->setCheckable( true );
|
||||||
verify( connect( a, SIGNAL( toggled( bool ) ), SLOT( updateToggled( bool ) ) ) );
|
verify( connect( a, SIGNAL( toggled( bool ) ), SLOT( updateToggled( bool ) ) ) );
|
||||||
myViewActions.insert( ViewFitAreaId, a );
|
myViewActions.insert( ViewFitAreaId, a );
|
||||||
|
|
||||||
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_ZOOM" ) ), "", this );
|
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_ZOOM" ) ), "", this );
|
||||||
a->setToolTip( tr( "TBR_ZOOM" ) );
|
a->setToolTip( tr( "TBR_ZOOM" ) );
|
||||||
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
|
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
|
||||||
a->setCheckable( true );
|
a->setCheckable( true );
|
||||||
verify( connect( a, SIGNAL( toggled( bool ) ), SLOT( updateToggled( bool ) ) ) );
|
verify( connect( a, SIGNAL( toggled( bool ) ), SLOT( updateToggled( bool ) ) ) );
|
||||||
myViewActions.insert( ViewZoomId, a );
|
myViewActions.insert( ViewZoomId, a );
|
||||||
|
|
||||||
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_PAN" ) ), "", this );
|
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_PAN" ) ), "", this );
|
||||||
a->setToolTip( tr( "TBR_PAN" ) );
|
a->setToolTip( tr( "TBR_PAN" ) );
|
||||||
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
|
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
|
||||||
a->setCheckable( true );
|
a->setCheckable( true );
|
||||||
verify( connect( a, SIGNAL( toggled( bool ) ), SLOT( updateToggled( bool ) ) ) );
|
verify( connect( a, SIGNAL( toggled( bool ) ), SLOT( updateToggled( bool ) ) ) );
|
||||||
myViewActions.insert( ViewPanId, a );
|
myViewActions.insert( ViewPanId, a );
|
||||||
|
|
||||||
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_GLOBALPAN" ) ), "", this );
|
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_GLOBALPAN" ) ), "", this );
|
||||||
a->setToolTip( tr( "TBR_GLOBALPAN" ) );
|
a->setToolTip( tr( "TBR_GLOBALPAN" ) );
|
||||||
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
|
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
|
||||||
a->setCheckable( true );
|
a->setCheckable( true );
|
||||||
verify( connect( a, SIGNAL( toggled( bool ) ), SLOT( updateToggled( bool ) ) ) );
|
verify( connect( a, SIGNAL( toggled( bool ) ), SLOT( updateToggled( bool ) ) ) );
|
||||||
myViewActions.insert( ViewGlobalPanId, a );
|
myViewActions.insert( ViewGlobalPanId, a );
|
||||||
|
|
||||||
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_FRONT" ) ), "", this );
|
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_FRONT" ) ), "", this );
|
||||||
a->setToolTip( tr( "TBR_FRONT" ) );
|
a->setToolTip( tr( "TBR_FRONT" ) );
|
||||||
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
|
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
|
||||||
myViewActions.insert( ViewFrontId, a );
|
myViewActions.insert( ViewFrontId, a );
|
||||||
|
|
||||||
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_BACK" ) ), "", this );
|
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_BACK" ) ), "", this );
|
||||||
a->setToolTip( tr( "TBR_BACK" ) );
|
a->setToolTip( tr( "TBR_BACK" ) );
|
||||||
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
|
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
|
||||||
myViewActions.insert( ViewBackId, a );
|
myViewActions.insert( ViewBackId, a );
|
||||||
|
|
||||||
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_TOP" ) ), "", this );
|
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_TOP" ) ), "", this );
|
||||||
a->setToolTip( tr( "TBR_TOP" ) );
|
a->setToolTip( tr( "TBR_TOP" ) );
|
||||||
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
|
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
|
||||||
myViewActions.insert( ViewTopId, a );
|
myViewActions.insert( ViewTopId, a );
|
||||||
|
|
||||||
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_BOTTOM" ) ), "", this );
|
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_BOTTOM" ) ), "", this );
|
||||||
a->setToolTip( tr( "TBR_BOTTOM" ) );
|
a->setToolTip( tr( "TBR_BOTTOM" ) );
|
||||||
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
|
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
|
||||||
myViewActions.insert( ViewBottomId, a );
|
myViewActions.insert( ViewBottomId, a );
|
||||||
|
|
||||||
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_LEFT" ) ), "", this );
|
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_LEFT" ) ), "", this );
|
||||||
a->setToolTip( tr( "TBR_LEFT" ) );
|
a->setToolTip( tr( "TBR_LEFT" ) );
|
||||||
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
|
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
|
||||||
myViewActions.insert( ViewLeftId, a );
|
myViewActions.insert( ViewLeftId, a );
|
||||||
|
|
||||||
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_RIGHT" ) ), "", this );
|
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_RIGHT" ) ), "", this );
|
||||||
a->setToolTip( tr( "TBR_RIGHT" ) );
|
a->setToolTip( tr( "TBR_RIGHT" ) );
|
||||||
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
|
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
|
||||||
myViewActions.insert( ViewRightId, a );
|
myViewActions.insert( ViewRightId, a );
|
||||||
|
|
||||||
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_AXO" ) ), "", this );
|
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_AXO" ) ), "", this );
|
||||||
a->setToolTip( tr( "TBR_AXO" ) );
|
a->setToolTip( tr( "TBR_AXO" ) );
|
||||||
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
|
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
|
||||||
myViewActions.insert( ViewAxoId, a );
|
myViewActions.insert( ViewAxoId, a );
|
||||||
|
|
||||||
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_ROTATION" ) ), "", this );
|
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_ROTATION" ) ), "", this );
|
||||||
a->setToolTip( tr( "TBR_ROTATION" ) );
|
a->setToolTip( tr( "TBR_ROTATION" ) );
|
||||||
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
|
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
|
||||||
a->setCheckable( true );
|
a->setCheckable( true );
|
||||||
verify( connect( a, SIGNAL( toggled( bool ) ), SLOT( updateToggled( bool ) ) ) );
|
verify( connect( a, SIGNAL( toggled( bool ) ), SLOT( updateToggled( bool ) ) ) );
|
||||||
myViewActions.insert( ViewRotationId, a );
|
myViewActions.insert( ViewRotationId, a );
|
||||||
|
|
||||||
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_RESET" ) ), "", this );
|
a = new QAction( QPixmap( dir + tr( "ICON_VIEW_RESET" ) ), "", this );
|
||||||
a->setToolTip( tr( "TBR_RESET" ) );
|
a->setToolTip( tr( "TBR_RESET" ) );
|
||||||
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
|
verify( connect( a, SIGNAL( activated() ), SLOT( onActionActivated() ) ) );
|
||||||
myViewActions.insert( ViewResetId, a );
|
myViewActions.insert( ViewResetId, a );
|
||||||
}
|
}
|
||||||
@ -257,14 +257,14 @@ void ViewOperations::initToolActions()
|
|||||||
// verify( connect( a, SIGNAL( activated() ), SLOT( onToolAction() ) ) );
|
// verify( connect( a, SIGNAL( activated() ), SLOT( onToolAction() ) ) );
|
||||||
// myToolActions->insert( PerViewId, a );
|
// myToolActions->insert( PerViewId, a );
|
||||||
|
|
||||||
QAction* a = new QAction( QPixmap( dir + tr( "ICON_TOOL_WIRE" ) ), "", this );
|
QAction* a = new QAction( QPixmap( dir + tr( "ICON_TOOL_WIRE" ) ), "", this );
|
||||||
a->setToolTip( tr( "TBR_TOOL_WIRE" ) );
|
a->setToolTip( tr( "TBR_TOOL_WIRE" ) );
|
||||||
a->setCheckable( true );
|
a->setCheckable( true );
|
||||||
verify( connect( a, SIGNAL( activated() ), SLOT( onToolAction() ) ) );
|
verify( connect( a, SIGNAL( activated() ), SLOT( onToolAction() ) ) );
|
||||||
myToolActions.insert( ToolWireframeId, a );
|
myToolActions.insert( ToolWireframeId, a );
|
||||||
|
|
||||||
a = new QAction( QPixmap( dir + tr( "ICON_TOOL_SHAD") ), "", this );
|
a = new QAction( QPixmap( dir + tr( "ICON_TOOL_SHAD") ), "", this );
|
||||||
a->setToolTip( tr( "TBR_TOOL_SHAD" ) );
|
a->setToolTip( tr( "TBR_TOOL_SHAD" ) );
|
||||||
a->setCheckable( true );
|
a->setCheckable( true );
|
||||||
a->setChecked( true );
|
a->setChecked( true );
|
||||||
verify( connect( a, SIGNAL( activated() ), SLOT( onToolAction() ) ) );
|
verify( connect( a, SIGNAL( activated() ), SLOT( onToolAction() ) ) );
|
||||||
|
@ -8,4 +8,5 @@ BRepMesh_ListOfInteger.hxx
|
|||||||
BRepMesh_BaseAllocator.hxx
|
BRepMesh_BaseAllocator.hxx
|
||||||
BRepMesh_PairOfIndex.hxx
|
BRepMesh_PairOfIndex.hxx
|
||||||
BRepMesh_Status.hxx
|
BRepMesh_Status.hxx
|
||||||
|
BRepMesh_CMPLRS.edl
|
||||||
EXTERNLIB
|
EXTERNLIB
|
||||||
|
Loading…
x
Reference in New Issue
Block a user