更新OCCT为8.0 V2
This commit is contained in:
parent
578c486238
commit
4d9d05d294
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -13,7 +13,7 @@ include_directories(${NATIVERENDER_ROOT_PATH}
|
||||
)
|
||||
|
||||
# OCCT 库目录
|
||||
set(OCCT_VERSION "7.9")
|
||||
set(OCCT_VERSION "8.0")
|
||||
set(OCCT_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../libs/${OHOS_ARCH})
|
||||
#OCCT LIBS
|
||||
set(OCCT_CORE_LIBS
|
||||
@ -63,6 +63,7 @@ find_library(GLES-lib GLESv3)
|
||||
#System so
|
||||
set(SYSTEM_LIBS
|
||||
libace_napi.z.so libnative_window.so libnative_display_manager.so
|
||||
libnative_drawing.so
|
||||
hilog_ndk.z ace_ndk.z libohinput.so uv z
|
||||
)
|
||||
|
||||
|
||||
@ -19,9 +19,9 @@ bool Axis::InitAxis(Handle(AIS_InteractiveContext) & context) {
|
||||
try {
|
||||
// 创建场景中心参考坐标系
|
||||
gp_Ax2 theAxis;
|
||||
double theSize = 60; // 大小
|
||||
double theSize =200; // 大小
|
||||
// 设置原点
|
||||
theAxis.SetLocation(gp_Pnt(10, 10, 10));
|
||||
theAxis.SetLocation(gp_Pnt(0, 0, 0));
|
||||
// 以世界坐标轴为准,设置Z,X轴方向
|
||||
theAxis.SetDirection(gp_Dir(0, 0, 1));
|
||||
theAxis.SetXDirection(gp_Dir(1, 0, 0));
|
||||
@ -29,7 +29,7 @@ bool Axis::InitAxis(Handle(AIS_InteractiveContext) & context) {
|
||||
axiPlacement = new Geom_Axis2Placement(theAxis);
|
||||
axiPlacement->SetLocation(gp::Origin());
|
||||
axiTrihedron = new AIS_Trihedron(axiPlacement);
|
||||
axiTrihedron->SetDatumDisplayMode(Prs3d_DM_Shaded);
|
||||
axiTrihedron->SetDatumDisplayMode(Prs3d_DM_WireFrame);
|
||||
axiTrihedron->SetDrawArrows(true);
|
||||
axiTrihedron->Attributes()->DatumAspect()->LineAspect(Prs3d_DP_XArrow)->SetWidth(2);
|
||||
axiTrihedron->Attributes()->DatumAspect()->LineAspect(Prs3d_DP_YArrow)->SetWidth(2);
|
||||
@ -70,9 +70,10 @@ bool Axis::InitAxisCube(Handle(AIS_InteractiveContext) & context) {
|
||||
axiViewCube->SetBoxSideLabel(V3d_Zneg, "Bottom");
|
||||
axiViewCube->SetDrawAxes(false);
|
||||
axiViewCube->SetSize(60, true);
|
||||
axiViewCube->SetTransparency(0.5);
|
||||
axiViewCube->SetTransparency(0.3);
|
||||
axiViewCube->SetFixedAnimationLoop(Standard_True);
|
||||
axiViewCube->SetTextColor(Quantity_Color(Quantity_NOC_BLUE1));
|
||||
axiViewCube->SetFontHeight(30);
|
||||
axiViewCube->SetFontHeight(100);
|
||||
axiViewCube->SetMaterial(Graphic3d_MaterialAspect(Graphic3d_NOM_ALUMINIUM));
|
||||
axiViewCube->SetTransformPersistence(
|
||||
new Graphic3d_TransformPers(Graphic3d_TMF_TriedronPers, Aspect_TOTP_RIGHT_UPPER, Graphic3d_Vec2i(100, 100)));
|
||||
|
||||
@ -9,78 +9,66 @@
|
||||
static std::mutex renderMutex;
|
||||
namespace NativeOpenCAX {
|
||||
|
||||
NativeRender::NativeRender(int w, int h):
|
||||
width(0),
|
||||
height(0),
|
||||
mAxis(new Axis),
|
||||
nAxis(new Axis),
|
||||
cr(new Camera),
|
||||
ctx(new Context),
|
||||
ogd(new OpenGlGraphicDriver),
|
||||
ts(new TextStyle),
|
||||
vw(new View),
|
||||
vr(new Viewer),
|
||||
win(new Window)
|
||||
{
|
||||
width=w;
|
||||
height=h;
|
||||
NativeRender::NativeRender(int w, int h)
|
||||
: width(0), height(0), mAxis(new Axis), nAxis(new Axis), cr(new Camera), ctx(new Context),
|
||||
ogd(new OpenGlGraphicDriver), ts(new TextStyle), vw(new View), vr(new Viewer), win(new Window) {
|
||||
width = w;
|
||||
height = h;
|
||||
}
|
||||
|
||||
NativeRender::~NativeRender() {
|
||||
shapes_.clear();
|
||||
}
|
||||
NativeRender::~NativeRender() { shapes_.clear(); }
|
||||
|
||||
bool NativeRender::init(EGLCore& _eglCore) {
|
||||
eglCore=_eglCore;
|
||||
if(!ogd->InitOpenGlGraphicDriver(eglCore)){
|
||||
HILOG_ERROR(NATIVE_TAG,"Init GraphicDriver Fail!");
|
||||
bool NativeRender::init(EGLCore &_eglCore) {
|
||||
eglCore = _eglCore;
|
||||
if (!ogd->InitOpenGlGraphicDriver(eglCore)) {
|
||||
HILOG_ERROR(NATIVE_TAG, "Init GraphicDriver Fail!");
|
||||
return false;
|
||||
}
|
||||
if(!ts->InitTextStyle()){
|
||||
HILOG_ERROR(NATIVE_TAG,"Init TextSyle Fail!");
|
||||
if (!ts->InitTextStyle()) {
|
||||
HILOG_ERROR(NATIVE_TAG, "Init TextSyle Fail!");
|
||||
return false;
|
||||
}
|
||||
if(!vr->InitViewer(ogd->graphicDriver)){
|
||||
HILOG_ERROR(NATIVE_TAG,"Init Viewer Fail!");
|
||||
if (!vr->InitViewer(ogd->graphicDriver)) {
|
||||
HILOG_ERROR(NATIVE_TAG, "Init Viewer Fail!");
|
||||
return false;
|
||||
}
|
||||
if(!ctx->InitContext(vr->viewer)){
|
||||
HILOG_ERROR(NATIVE_TAG,"Init Ctx Fail!");
|
||||
if (!ctx->InitContext(vr->viewer)) {
|
||||
HILOG_ERROR(NATIVE_TAG, "Init Ctx Fail!");
|
||||
return false;
|
||||
}
|
||||
if(!mAxis->InitAxis(ctx->context)){
|
||||
HILOG_ERROR(NATIVE_TAG,"Init AXIS Fail!");
|
||||
if (!mAxis->InitAxis(ctx->context)) {
|
||||
HILOG_ERROR(NATIVE_TAG, "Init AXIS Fail!");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!mAxis->InitAxisCube(ctx->context)){
|
||||
HILOG_ERROR(NATIVE_TAG,"Init AXIS Cuba Fail!");
|
||||
|
||||
if (!mAxis->InitAxisCube(ctx->context)) {
|
||||
HILOG_ERROR(NATIVE_TAG, "Init AXIS Cuba Fail!");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!win->InitWindow(width,height)){
|
||||
HILOG_ERROR(NATIVE_TAG,"Init Window Fail!");
|
||||
|
||||
if (!win->InitWindow(width, height)) {
|
||||
HILOG_ERROR(NATIVE_TAG, "Init Window Fail!");
|
||||
return false;
|
||||
}
|
||||
if(!vw->InitView(vr->viewer)){
|
||||
HILOG_ERROR(NATIVE_TAG,"Init View Fail!");
|
||||
if (!vw->InitView(vr->viewer)) {
|
||||
HILOG_ERROR(NATIVE_TAG, "Init View Fail!");
|
||||
return false;
|
||||
}else{
|
||||
} else {
|
||||
vw->SetViewOption();
|
||||
vw->SetText(ts->text);
|
||||
vw->SetWin(win->window);
|
||||
}
|
||||
if(!cr->InitCamera(vw->view)){
|
||||
HILOG_ERROR(NATIVE_TAG,"Init Camera Fail!");
|
||||
if (!cr->InitCamera(vw->view)) {
|
||||
HILOG_ERROR(NATIVE_TAG, "Init Camera Fail!");
|
||||
return false;
|
||||
}
|
||||
vw->ResetView();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool NativeRender::loadModel(const std::string& filePath) {
|
||||
bool NativeRender::loadModel(const std::string &filePath) {
|
||||
// 清除现有模型
|
||||
for (auto& shape : shapes_) {
|
||||
for (auto &shape : shapes_) {
|
||||
ctx->context->Remove(shape, Standard_False);
|
||||
}
|
||||
shapes_.clear();
|
||||
@ -113,32 +101,46 @@ bool NativeRender::loadModel(const std::string& filePath) {
|
||||
gp_Trsf move;
|
||||
move.SetTranslation(translation);
|
||||
BRepBuilderAPI_Transform transformer(shape, move);
|
||||
shape=transformer.Shape();
|
||||
shape = transformer.Shape();
|
||||
if (!shape.IsNull()) {
|
||||
Handle(AIS_Shape) aisShape = new AIS_Shape(shape);
|
||||
|
||||
// 设置材质
|
||||
Handle(Prs3d_Drawer) drawer = aisShape->Attributes();
|
||||
Handle(Prs3d_ShadingAspect) shadingAspect = new Prs3d_ShadingAspect();
|
||||
//aisShape->SetDisplayMode(1);
|
||||
Handle(Prs3d_LineAspect) aLineAspect = new Prs3d_LineAspect(
|
||||
Quantity_NOC_BLACK, // 颜色,例如黑色
|
||||
Aspect_TOL_DASH, // 线型
|
||||
3.0 // 线宽
|
||||
// aisShape->SetDisplayMode(1);
|
||||
Handle(Prs3d_LineAspect) aLineAspect = new Prs3d_LineAspect(Quantity_NOC_BLACK, // 颜色,例如黑色
|
||||
Aspect_TOL_DASH, // 线型
|
||||
3.0 // 线宽
|
||||
);
|
||||
|
||||
|
||||
// 随机颜色
|
||||
int colorIndex = i % 7;
|
||||
Quantity_Color color;
|
||||
switch (colorIndex) {
|
||||
case 0: color = Quantity_NOC_RED; break;
|
||||
case 1: color = Quantity_NOC_GREEN; break;
|
||||
case 2: color = Quantity_NOC_BLUE1; break;
|
||||
case 3: color = Quantity_NOC_YELLOW; break;
|
||||
case 4: color = Quantity_NOC_MAGENTA1; break;
|
||||
case 5: color = Quantity_NOC_CYAN1; break;
|
||||
case 6: color = Quantity_NOC_ORANGE; break;
|
||||
default: color = Quantity_NOC_WHITE;
|
||||
case 0:
|
||||
color = Quantity_NOC_RED;
|
||||
break;
|
||||
case 1:
|
||||
color = Quantity_NOC_GREEN;
|
||||
break;
|
||||
case 2:
|
||||
color = Quantity_NOC_BLUE1;
|
||||
break;
|
||||
case 3:
|
||||
color = Quantity_NOC_YELLOW;
|
||||
break;
|
||||
case 4:
|
||||
color = Quantity_NOC_MAGENTA1;
|
||||
break;
|
||||
case 5:
|
||||
color = Quantity_NOC_CYAN1;
|
||||
break;
|
||||
case 6:
|
||||
color = Quantity_NOC_ORANGE;
|
||||
break;
|
||||
default:
|
||||
color = Quantity_NOC_WHITE;
|
||||
}
|
||||
shadingAspect->SetColor(color);
|
||||
shadingAspect->SetMaterial(Graphic3d_NOM_PLASTIC);
|
||||
@ -146,7 +148,7 @@ bool NativeRender::loadModel(const std::string& filePath) {
|
||||
drawer->SetWireAspect(aLineAspect);
|
||||
drawer->SetShadingAspect(shadingAspect);
|
||||
ctx->context->Display(aisShape, Standard_True);
|
||||
//ctx->context->SetDisplayMode(AIS_WireFrame, Standard_False);
|
||||
// ctx->context->SetDisplayMode(AIS_WireFrame, Standard_False);
|
||||
shapes_.push_back(aisShape);
|
||||
}
|
||||
}
|
||||
@ -154,11 +156,12 @@ bool NativeRender::loadModel(const std::string& filePath) {
|
||||
vw->view->FitAll(0.5, Standard_True);
|
||||
vw->view->ZFitAll();
|
||||
vw->ResetView();
|
||||
OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "LoadModel","Successfully loaded STEP file with %{public}d shapes",numShapes);
|
||||
OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "LoadModel",
|
||||
"Successfully loaded STEP file with %{public}d shapes", numShapes);
|
||||
return true;
|
||||
}
|
||||
|
||||
//setTranslation
|
||||
// setTranslation
|
||||
void NativeRender::setTranslation(float tx, float ty) {
|
||||
nAxis->SetTranslationX(tx);
|
||||
nAxis->SetTranslationY(ty);
|
||||
@ -166,7 +169,7 @@ void NativeRender::setTranslation(float tx, float ty) {
|
||||
|
||||
void NativeRender::render() {
|
||||
if (vw->view.IsNull()) {
|
||||
OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Render","View Is Null");
|
||||
OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_PRINT_DOMAIN, "Render", "View Is Null");
|
||||
return;
|
||||
}
|
||||
vw->MustBeResized();
|
||||
@ -174,26 +177,46 @@ void NativeRender::render() {
|
||||
}
|
||||
|
||||
void NativeRender::resize(int w, int h) {
|
||||
HILOG_ERROR(NATIVE_TAG,"InPut Size:%{public}d,%{public}d",w,h);
|
||||
win->Resize(w,h);
|
||||
HILOG_ERROR(NATIVE_TAG, "InPut Size:%{public}d,%{public}d", w, h);
|
||||
win->Resize(w, h);
|
||||
}
|
||||
|
||||
void NativeRender::setRotation(float xAngle, float yAngle) {
|
||||
cr->SetRotation(xAngle, yAngle);
|
||||
}
|
||||
void NativeRender::setRotation(float xAngle, float yAngle) { cr->SetRotation(xAngle, yAngle); }
|
||||
|
||||
void NativeRender::setZoomLevel(float zoom) {
|
||||
nAxis->SetZoomLevel(std::max(0.1f, std::min(zoom, 5.0f))); // 限制缩放范围
|
||||
}
|
||||
void NativeRender::setClearColor(float r, float g, float b, float a){
|
||||
vw->SetClearColor( r, g, b, a);
|
||||
}
|
||||
void NativeRender::resetView() {
|
||||
vw->ResetView();
|
||||
}
|
||||
void NativeRender::SwitchView(std::string view){
|
||||
void NativeRender::setClearColor(float r, float g, float b, float a) { vw->SetClearColor(r, g, b, a); }
|
||||
void NativeRender::resetView() { vw->ResetView(); }
|
||||
void NativeRender::SwitchView(std::string view) {
|
||||
vw->SwitchView(view);
|
||||
OH_Drawing_FontConfigInfoErrorCode fontConfigInfoErrorCode; // 用于接收错误代码
|
||||
OH_Drawing_FontConfigInfo* fontConfigInfo = OH_Drawing_GetSystemFontConfigInfo(&fontConfigInfoErrorCode);
|
||||
if(fontConfigInfoErrorCode != SUCCESS_FONT_CONFIG_INFO) {
|
||||
OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_DOMAIN, "PrintSysFontMetrics", "获取系统信息失败,错误代码为: %{public}d", fontConfigInfoErrorCode);
|
||||
}
|
||||
// 获取系统字体配置信息示例
|
||||
if (fontConfigInfo != nullptr) {
|
||||
// 获取字体文件路径数量,打印日志
|
||||
size_t fontDirCount = fontConfigInfo->fontDirSize;
|
||||
OH_LOG_Print(LOG_APP, LOG_INFO, LOG_DOMAIN, "PrintSysFontMetrics", "字体文件路径数量为: %{public}zu\n", fontDirCount);
|
||||
// 遍历字体文件路径列表,打印日志
|
||||
for (size_t i = 0; i < fontDirCount; ++i) {
|
||||
OH_LOG_Print(LOG_APP, LOG_INFO, LOG_DOMAIN, "PrintSysFontMetrics", "字体文件路径为: %{public}s\n",
|
||||
fontConfigInfo->fontDirSet[i]);
|
||||
}
|
||||
// 获取通用字体集数量,打印日志
|
||||
size_t genericCount = fontConfigInfo->fontGenericInfoSize;
|
||||
OH_LOG_Print(LOG_APP, LOG_INFO, LOG_DOMAIN, "PrintSysFontMetrics", "通用字体集数量为: %{public}zu\n", genericCount);
|
||||
// 遍历获取每个通用字体集中的字体家族名(例如 HarmonyOS Sans),打印日志
|
||||
for (size_t i = 0; i < genericCount; ++i) {
|
||||
OH_Drawing_FontGenericInfo &genericInfo = fontConfigInfo->fontGenericInfoSet[i];
|
||||
OH_LOG_Print(LOG_APP, LOG_INFO, LOG_DOMAIN, "PrintSysFontMetrics",
|
||||
"获取第%{public}zu个通用字体集中的字体家族名为: %{public}s", i, genericInfo.familyName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace NativeRenderer
|
||||
} // namespace NativeOpenCAX
|
||||
@ -23,6 +23,11 @@
|
||||
#include "View/View.h"
|
||||
#include "Viewer/Viewer.h"
|
||||
#include "Viewer/Viewer.h"
|
||||
|
||||
#include <native_drawing/drawing_font_collection.h>
|
||||
#include <native_drawing/drawing_text_typography.h>
|
||||
#include <native_drawing/drawing_register_font.h>
|
||||
|
||||
namespace NativeOpenCAX {
|
||||
|
||||
class NativeRender {
|
||||
|
||||
@ -63,7 +63,11 @@ void View::SetClearColor(float r, float g, float b, float a) {
|
||||
}
|
||||
}
|
||||
void View::MustBeResized() { view->MustBeResized(); }
|
||||
void View::Redraw() { view->Redraw(); }
|
||||
|
||||
void View::Redraw() {
|
||||
view->ZFitAll();
|
||||
view->Redraw();
|
||||
}
|
||||
void View::ResetView() {
|
||||
if (!view.IsNull()) {
|
||||
view->SetProj(V3d_XposYnegZpos);
|
||||
|
||||
@ -17,9 +17,9 @@
|
||||
#ifndef _AIS_HeaderFile
|
||||
#define _AIS_HeaderFile
|
||||
|
||||
#include "Prs3d_Presentation.hxx"
|
||||
#include "Standard.hxx"
|
||||
#include "Standard_DefineAlloc.hxx"
|
||||
#include <Prs3d_Presentation.hxx>
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
|
||||
//! Application Interactive Services provide the means to create links between an application GUI
|
||||
//! viewer and the packages which are used to manage selection and presentation. The tools AIS
|
||||
@ -48,7 +48,7 @@
|
||||
//! (equivalent to None.) If you want to give a particular type and signature to your interactive
|
||||
//! object, you must redefine the two virtual methods: Type and Signature. In the C++ inheritance
|
||||
//! structure of the package, each class representing a specific Interactive Object inherits
|
||||
//! AIS_InteractiveObject. Among these inheriting classes, AIS_Relation functions as the abstract
|
||||
//! AIS_InteractiveObject. Among these inheriting classes, PrsDim_Relation functions as the abstract
|
||||
//! mother class for tinheriting classes defining display of specific relational constraints and
|
||||
//! types of dimension. Some of these include:
|
||||
//! - display of constraints based on relations of symmetry, tangency, parallelism and
|
||||
|
||||
@ -1,22 +0,0 @@
|
||||
// Copyright (c) 2020 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _AIS_AngleDimension_HeaderFile
|
||||
#define _AIS_AngleDimension_HeaderFile
|
||||
|
||||
#include "PrsDim_AngleDimension.hxx"
|
||||
|
||||
Standard_DEPRECATED("Deprecated alias to moved class")
|
||||
typedef PrsDim_AngleDimension AIS_AngleDimension;
|
||||
|
||||
#endif // _AIS_AngleDimension_HeaderFile
|
||||
@ -15,18 +15,18 @@
|
||||
#ifndef _AIS_Animation_HeaderFile
|
||||
#define _AIS_Animation_HeaderFile
|
||||
|
||||
#include "AIS_AnimationTimer.hxx"
|
||||
#include "NCollection_Sequence.hxx"
|
||||
#include "TCollection_AsciiString.hxx"
|
||||
#include <AIS_AnimationTimer.hxx>
|
||||
#include <NCollection_Sequence.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
//! Structure defining current animation progress.
|
||||
struct AIS_AnimationProgress
|
||||
{
|
||||
Standard_Real Pts; //!< global presentation timestamp
|
||||
Standard_Real LocalPts; //!< presentation within current animation
|
||||
// clang-format off
|
||||
Standard_Real LocalNormalized; //!< normalized position within current animation within 0..1 range
|
||||
// clang-format on
|
||||
double Pts; //!< global presentation timestamp
|
||||
double LocalPts; //!< presentation within current animation
|
||||
// clang-format off
|
||||
double LocalNormalized; //!< normalized position within current animation within 0..1 range
|
||||
// clang-format on
|
||||
|
||||
AIS_AnimationProgress()
|
||||
: Pts(-1.0),
|
||||
@ -36,8 +36,6 @@ struct AIS_AnimationProgress
|
||||
}
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE(AIS_Animation, Standard_Transient)
|
||||
|
||||
//! Class represents a basic animation class.
|
||||
//! AIS_Animation can be used as:
|
||||
//!
|
||||
@ -82,56 +80,57 @@ public:
|
||||
Standard_EXPORT AIS_Animation(const TCollection_AsciiString& theAnimationName);
|
||||
|
||||
//! Destruct object, clear arguments
|
||||
Standard_EXPORT virtual ~AIS_Animation();
|
||||
Standard_EXPORT ~AIS_Animation() override;
|
||||
|
||||
//! Animation name.
|
||||
const TCollection_AsciiString& Name() const { return myName; }
|
||||
|
||||
public:
|
||||
//! @return start time of the animation in the timeline
|
||||
Standard_Real StartPts() const { return myPtsStart; }
|
||||
double StartPts() const { return myPtsStart; }
|
||||
|
||||
//! Sets time limits for animation in the animation timeline
|
||||
void SetStartPts(const Standard_Real thePtsStart) { myPtsStart = thePtsStart; }
|
||||
void SetStartPts(const double thePtsStart) { myPtsStart = thePtsStart; }
|
||||
|
||||
//! @return duration of the animation in the timeline
|
||||
Standard_Real Duration() const { return Max(myOwnDuration, myChildrenDuration); }
|
||||
double Duration() const { return (std::max)(myOwnDuration, myChildrenDuration); }
|
||||
|
||||
//! Update total duration considering all animations on timeline.
|
||||
Standard_EXPORT void UpdateTotalDuration();
|
||||
|
||||
//! Return true if duration is defined.
|
||||
Standard_Boolean HasOwnDuration() const { return myOwnDuration > 0.0; }
|
||||
bool HasOwnDuration() const { return myOwnDuration > 0.0; }
|
||||
|
||||
//! @return own duration of the animation in the timeline
|
||||
Standard_Real OwnDuration() const { return myOwnDuration; }
|
||||
double OwnDuration() const { return myOwnDuration; }
|
||||
|
||||
//! Defines duration of the animation.
|
||||
void SetOwnDuration(const Standard_Real theDuration) { myOwnDuration = theDuration; }
|
||||
void SetOwnDuration(const double theDuration) { myOwnDuration = theDuration; }
|
||||
|
||||
//! Add single animation to the timeline.
|
||||
//! @param theAnimation input animation
|
||||
Standard_EXPORT void Add(const Handle(AIS_Animation)& theAnimation);
|
||||
Standard_EXPORT void Add(const occ::handle<AIS_Animation>& theAnimation);
|
||||
|
||||
//! Clear animation timeline - remove all animations from it.
|
||||
Standard_EXPORT void Clear();
|
||||
|
||||
//! Return the child animation with the given name.
|
||||
Standard_EXPORT Handle(AIS_Animation) Find(const TCollection_AsciiString& theAnimationName) const;
|
||||
Standard_EXPORT occ::handle<AIS_Animation> Find(
|
||||
const TCollection_AsciiString& theAnimationName) const;
|
||||
|
||||
//! Remove the child animation.
|
||||
Standard_EXPORT Standard_Boolean Remove(const Handle(AIS_Animation)& theAnimation);
|
||||
Standard_EXPORT bool Remove(const occ::handle<AIS_Animation>& theAnimation);
|
||||
|
||||
//! Replace the child animation.
|
||||
Standard_EXPORT Standard_Boolean Replace(const Handle(AIS_Animation)& theAnimationOld,
|
||||
const Handle(AIS_Animation)& theAnimationNew);
|
||||
Standard_EXPORT bool Replace(const occ::handle<AIS_Animation>& theAnimationOld,
|
||||
const occ::handle<AIS_Animation>& theAnimationNew);
|
||||
|
||||
//! Clears own children and then copy child animations from another object.
|
||||
//! Copy also Start Time and Duration values.
|
||||
Standard_EXPORT void CopyFrom(const Handle(AIS_Animation)& theOther);
|
||||
Standard_EXPORT void CopyFrom(const occ::handle<AIS_Animation>& theOther);
|
||||
|
||||
//! Return sequence of child animations.
|
||||
const NCollection_Sequence<Handle(AIS_Animation)>& Children() const { return myAnimations; }
|
||||
const NCollection_Sequence<occ::handle<AIS_Animation>>& Children() const { return myAnimations; }
|
||||
|
||||
public:
|
||||
//! Start animation with internally defined timer instance.
|
||||
@ -147,29 +146,29 @@ public:
|
||||
//! @param thePlaySpeed playback speed (1.0 means normal speed)
|
||||
//! @param theToUpdate flag to update defined animations to specified start position
|
||||
//! @param theToStopTimer flag to pause timer at the starting position
|
||||
Standard_EXPORT virtual void StartTimer(const Standard_Real theStartPts,
|
||||
const Standard_Real thePlaySpeed,
|
||||
const Standard_Boolean theToUpdate,
|
||||
const Standard_Boolean theToStopTimer = Standard_False);
|
||||
Standard_EXPORT virtual void StartTimer(const double theStartPts,
|
||||
const double thePlaySpeed,
|
||||
const bool theToUpdate,
|
||||
const bool theToStopTimer = false);
|
||||
|
||||
//! Update single frame of animation, update timer state
|
||||
//! @return current time of timeline progress.
|
||||
Standard_EXPORT virtual Standard_Real UpdateTimer();
|
||||
Standard_EXPORT virtual double UpdateTimer();
|
||||
|
||||
//! Return elapsed time.
|
||||
Standard_Real ElapsedTime() const { return !myTimer.IsNull() ? myTimer->ElapsedTime() : 0.0; }
|
||||
double ElapsedTime() const { return !myTimer.IsNull() ? myTimer->ElapsedTime() : 0.0; }
|
||||
|
||||
//! Return playback timer.
|
||||
const Handle(Media_Timer)& Timer() const { return myTimer; }
|
||||
const occ::handle<Media_Timer>& Timer() const { return myTimer; }
|
||||
|
||||
//! Set playback timer.
|
||||
void SetTimer(const Handle(Media_Timer)& theTimer) { myTimer = theTimer; }
|
||||
void SetTimer(const occ::handle<Media_Timer>& theTimer) { myTimer = theTimer; }
|
||||
|
||||
public:
|
||||
//! Start animation. This method changes status of the animation to Started.
|
||||
//! This status defines whether animation is to be performed in the timeline or not.
|
||||
//! @param theToUpdate call Update() method
|
||||
Standard_EXPORT virtual void Start(const Standard_Boolean theToUpdate);
|
||||
Standard_EXPORT virtual void Start(const bool theToUpdate);
|
||||
|
||||
//! Pause the process timeline.
|
||||
Standard_EXPORT virtual void Pause();
|
||||
@ -185,7 +184,7 @@ public:
|
||||
//! Update single frame of animation, update timer state
|
||||
//! @param[in] thePts the time moment within [0; Duration()]
|
||||
//! @return True if timeline is in progress
|
||||
Standard_EXPORT virtual Standard_Boolean Update(const Standard_Real thePts);
|
||||
Standard_EXPORT virtual bool Update(const double thePts);
|
||||
|
||||
protected:
|
||||
//! Process one step of the animation according to the input time progress, including all
|
||||
@ -205,15 +204,15 @@ protected:
|
||||
};
|
||||
|
||||
protected:
|
||||
Handle(Media_Timer) myTimer;
|
||||
occ::handle<Media_Timer> myTimer;
|
||||
|
||||
TCollection_AsciiString myName; //!< animation name
|
||||
NCollection_Sequence<Handle(AIS_Animation)> myAnimations; //!< sequence of child animations
|
||||
TCollection_AsciiString myName; //!< animation name
|
||||
NCollection_Sequence<occ::handle<AIS_Animation>> myAnimations; //!< sequence of child animations
|
||||
|
||||
AnimationState myState; //!< animation state - started, stopped of paused
|
||||
Standard_Real myPtsStart; //!< time of start in the timeline
|
||||
Standard_Real myOwnDuration; //!< duration of animation excluding children
|
||||
Standard_Real myChildrenDuration; //!< duration of animation including children
|
||||
double myPtsStart; //!< time of start in the timeline
|
||||
double myOwnDuration; //!< duration of animation excluding children
|
||||
double myChildrenDuration; //!< duration of animation including children
|
||||
};
|
||||
|
||||
#endif // _AIS_Animation_HeaderFile
|
||||
|
||||
@ -14,8 +14,8 @@
|
||||
#ifndef _AIS_AnimationAxisRotation_HeaderFile
|
||||
#define _AIS_AnimationAxisRotation_HeaderFile
|
||||
|
||||
#include "AIS_BaseAnimationObject.hxx"
|
||||
#include "gp_TrsfNLerp.hxx"
|
||||
#include <AIS_BaseAnimationObject.hxx>
|
||||
#include <gp_TrsfNLerp.hxx>
|
||||
|
||||
//! Animation defining object transformation.
|
||||
class AIS_AnimationAxisRotation : public AIS_BaseAnimationObject
|
||||
@ -29,21 +29,21 @@ public:
|
||||
//! @param[in] theAxis rotation axis
|
||||
//! @param[in] theAngleStart rotation angle at the start of animation
|
||||
//! @param[in] theAngleEnd rotation angle at the end of animation
|
||||
Standard_EXPORT AIS_AnimationAxisRotation(const TCollection_AsciiString& theAnimationName,
|
||||
const Handle(AIS_InteractiveContext)& theContext,
|
||||
const Handle(AIS_InteractiveObject)& theObject,
|
||||
const gp_Ax1& theAxis,
|
||||
const Standard_Real theAngleStart,
|
||||
const Standard_Real theAngleEnd);
|
||||
Standard_EXPORT AIS_AnimationAxisRotation(const TCollection_AsciiString& theAnimationName,
|
||||
const occ::handle<AIS_InteractiveContext>& theContext,
|
||||
const occ::handle<AIS_InteractiveObject>& theObject,
|
||||
const gp_Ax1& theAxis,
|
||||
const double theAngleStart,
|
||||
const double theAngleEnd);
|
||||
|
||||
protected:
|
||||
//! Update the progress.
|
||||
Standard_EXPORT virtual void update(const AIS_AnimationProgress& theProgress) Standard_OVERRIDE;
|
||||
Standard_EXPORT void update(const AIS_AnimationProgress& theProgress) override;
|
||||
|
||||
private:
|
||||
gp_Ax1 myRotAxis; //!< rotation axis
|
||||
Standard_Real myAngleStart; //!< start angle for rotation
|
||||
Standard_Real myAngleEnd; //!< end angle for rotation
|
||||
gp_Ax1 myRotAxis; //!< rotation axis
|
||||
double myAngleStart; //!< start angle for rotation
|
||||
double myAngleEnd; //!< end angle for rotation
|
||||
};
|
||||
|
||||
#endif // _AIS_AnimationAxisRotation_HeaderFile
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
#ifndef _AIS_AnimationCamera_HeaderFile
|
||||
#define _AIS_AnimationCamera_HeaderFile
|
||||
|
||||
#include "AIS_Animation.hxx"
|
||||
#include <AIS_Animation.hxx>
|
||||
|
||||
class Graphic3d_Camera;
|
||||
class V3d_View;
|
||||
@ -27,39 +27,37 @@ class AIS_AnimationCamera : public AIS_Animation
|
||||
public:
|
||||
//! Main constructor.
|
||||
Standard_EXPORT AIS_AnimationCamera(const TCollection_AsciiString& theAnimationName,
|
||||
const Handle(V3d_View)& theView);
|
||||
const occ::handle<V3d_View>& theView);
|
||||
|
||||
//! Return the target view.
|
||||
const Handle(V3d_View)& View() const { return myView; }
|
||||
const occ::handle<V3d_View>& View() const { return myView; }
|
||||
|
||||
//! Set target view.
|
||||
void SetView(const Handle(V3d_View)& theView) { myView = theView; }
|
||||
void SetView(const occ::handle<V3d_View>& theView) { myView = theView; }
|
||||
|
||||
//! Return camera start position.
|
||||
const Handle(Graphic3d_Camera)& CameraStart() const { return myCamStart; }
|
||||
const occ::handle<Graphic3d_Camera>& CameraStart() const { return myCamStart; }
|
||||
|
||||
//! Define camera start position.
|
||||
void SetCameraStart(const Handle(Graphic3d_Camera)& theCameraStart)
|
||||
void SetCameraStart(const occ::handle<Graphic3d_Camera>& theCameraStart)
|
||||
{
|
||||
myCamStart = theCameraStart;
|
||||
}
|
||||
|
||||
//! Return camera end position.
|
||||
const Handle(Graphic3d_Camera)& CameraEnd() const { return myCamEnd; }
|
||||
const occ::handle<Graphic3d_Camera>& CameraEnd() const { return myCamEnd; }
|
||||
|
||||
//! Define camera end position.
|
||||
void SetCameraEnd(const Handle(Graphic3d_Camera)& theCameraEnd) { myCamEnd = theCameraEnd; }
|
||||
void SetCameraEnd(const occ::handle<Graphic3d_Camera>& theCameraEnd) { myCamEnd = theCameraEnd; }
|
||||
|
||||
protected:
|
||||
//! Update the progress.
|
||||
Standard_EXPORT virtual void update(const AIS_AnimationProgress& theProgress) Standard_OVERRIDE;
|
||||
Standard_EXPORT void update(const AIS_AnimationProgress& theProgress) override;
|
||||
|
||||
protected:
|
||||
Handle(V3d_View) myView; //!< view to setup camera
|
||||
Handle(Graphic3d_Camera) myCamStart; //!< starting camera position
|
||||
Handle(Graphic3d_Camera) myCamEnd; //!< end camera position
|
||||
occ::handle<V3d_View> myView; //!< view to setup camera
|
||||
occ::handle<Graphic3d_Camera> myCamStart; //!< starting camera position
|
||||
occ::handle<Graphic3d_Camera> myCamEnd; //!< end camera position
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE(AIS_AnimationCamera, AIS_Animation)
|
||||
|
||||
#endif // _AIS_AnimationCamera_HeaderFile
|
||||
|
||||
@ -15,8 +15,8 @@
|
||||
#ifndef _AIS_AnimationObject_HeaderFile
|
||||
#define _AIS_AnimationObject_HeaderFile
|
||||
|
||||
#include "AIS_BaseAnimationObject.hxx"
|
||||
#include "gp_TrsfNLerp.hxx"
|
||||
#include <AIS_BaseAnimationObject.hxx>
|
||||
#include <gp_TrsfNLerp.hxx>
|
||||
|
||||
//! Animation defining object transformation.
|
||||
class AIS_AnimationObject : public AIS_BaseAnimationObject
|
||||
@ -32,18 +32,18 @@ public:
|
||||
//! @param[in] theTrsfStart local transformation at the start of animation (e.g.
|
||||
//! theObject->LocalTransformation())
|
||||
//! @param[in] theTrsfEnd local transformation at the end of animation
|
||||
Standard_EXPORT AIS_AnimationObject(const TCollection_AsciiString& theAnimationName,
|
||||
const Handle(AIS_InteractiveContext)& theContext,
|
||||
const Handle(AIS_InteractiveObject)& theObject,
|
||||
const gp_Trsf& theTrsfStart,
|
||||
const gp_Trsf& theTrsfEnd);
|
||||
Standard_EXPORT AIS_AnimationObject(const TCollection_AsciiString& theAnimationName,
|
||||
const occ::handle<AIS_InteractiveContext>& theContext,
|
||||
const occ::handle<AIS_InteractiveObject>& theObject,
|
||||
const gp_Trsf& theTrsfStart,
|
||||
const gp_Trsf& theTrsfEnd);
|
||||
|
||||
protected:
|
||||
//! Update the progress.
|
||||
Standard_EXPORT virtual void update(const AIS_AnimationProgress& theProgress) Standard_OVERRIDE;
|
||||
Standard_EXPORT void update(const AIS_AnimationProgress& theProgress) override;
|
||||
|
||||
private:
|
||||
gp_TrsfNLerp myTrsfLerp; //!< interpolation tool
|
||||
NCollection_Lerp<gp_Trsf> myTrsfLerp; //!< interpolation tool
|
||||
};
|
||||
|
||||
#endif // _AIS_AnimationObject_HeaderFile
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
#ifndef _AIS_AnimationTimer_HeaderFile
|
||||
#define _AIS_AnimationTimer_HeaderFile
|
||||
|
||||
#include "Media_Timer.hxx"
|
||||
#include <Media_Timer.hxx>
|
||||
typedef Media_Timer AIS_AnimationTimer;
|
||||
|
||||
#endif // _AIS_AnimationTimer_HeaderFile
|
||||
|
||||
@ -17,17 +17,14 @@
|
||||
#ifndef _AIS_AttributeFilter_HeaderFile
|
||||
#define _AIS_AttributeFilter_HeaderFile
|
||||
|
||||
#include "Standard.hxx"
|
||||
#include "Standard_Type.hxx"
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include "Quantity_NameOfColor.hxx"
|
||||
#include "Standard_Real.hxx"
|
||||
#include "SelectMgr_Filter.hxx"
|
||||
#include <Quantity_NameOfColor.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <SelectMgr_Filter.hxx>
|
||||
class SelectMgr_EntityOwner;
|
||||
|
||||
class AIS_AttributeFilter;
|
||||
DEFINE_STANDARD_HANDLE(AIS_AttributeFilter, SelectMgr_Filter)
|
||||
|
||||
//! Selects Interactive Objects, which have the desired width or color.
|
||||
//! The filter questions each Interactive Object in local
|
||||
//! context to determine whether it has an non-null
|
||||
@ -52,55 +49,54 @@ public:
|
||||
|
||||
//! Constructs an attribute filter object defined by the line
|
||||
//! width attribute aWidth.
|
||||
Standard_EXPORT AIS_AttributeFilter(const Standard_Real aWidth);
|
||||
Standard_EXPORT AIS_AttributeFilter(const double aWidth);
|
||||
|
||||
//! Indicates that the Interactive Object has the color
|
||||
//! setting specified by the argument aCol at construction time.
|
||||
Standard_Boolean HasColor() const { return hasC; }
|
||||
bool HasColor() const { return hasC; }
|
||||
|
||||
//! Indicates that the Interactive Object has the width
|
||||
//! setting specified by the argument aWidth at
|
||||
//! construction time.
|
||||
Standard_Boolean HasWidth() const { return hasW; }
|
||||
bool HasWidth() const { return hasW; }
|
||||
|
||||
//! Sets the color.
|
||||
void SetColor(const Quantity_NameOfColor theCol)
|
||||
{
|
||||
myCol = theCol;
|
||||
hasC = Standard_True;
|
||||
hasC = true;
|
||||
}
|
||||
|
||||
//! Sets the line width.
|
||||
void SetWidth(const Standard_Real theWidth)
|
||||
void SetWidth(const double theWidth)
|
||||
{
|
||||
myWid = theWidth;
|
||||
hasW = Standard_True;
|
||||
hasW = true;
|
||||
}
|
||||
|
||||
//! Removes the setting for color from the filter.
|
||||
void UnsetColor() { hasC = Standard_False; }
|
||||
void UnsetColor() { hasC = false; }
|
||||
|
||||
//! Removes the setting for width from the filter.
|
||||
void UnsetWidth() { hasW = Standard_False; }
|
||||
void UnsetWidth() { hasW = false; }
|
||||
|
||||
//! Indicates that the selected Interactive Object passes
|
||||
//! the filter. The owner, anObj, can be either direct or
|
||||
//! user. A direct owner is the corresponding
|
||||
//! construction element, whereas a user is the
|
||||
//! compound shape of which the entity forms a part.
|
||||
//! If the Interactive Object returns Standard_True
|
||||
//! If the Interactive Object returns true
|
||||
//! when detected by the Local Context selector through
|
||||
//! the mouse, the object is kept; if not, it is rejected.
|
||||
Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& anObj) const
|
||||
Standard_OVERRIDE;
|
||||
Standard_EXPORT bool IsOk(const occ::handle<SelectMgr_EntityOwner>& anObj) const override;
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_AttributeFilter, SelectMgr_Filter)
|
||||
|
||||
private:
|
||||
Quantity_NameOfColor myCol;
|
||||
Standard_Real myWid;
|
||||
Standard_Boolean hasC;
|
||||
Standard_Boolean hasW;
|
||||
double myWid;
|
||||
bool hasC;
|
||||
bool hasW;
|
||||
};
|
||||
|
||||
#endif // _AIS_AttributeFilter_HeaderFile
|
||||
|
||||
@ -17,11 +17,11 @@
|
||||
#ifndef _AIS_Axis_HeaderFile
|
||||
#define _AIS_Axis_HeaderFile
|
||||
|
||||
#include "AIS_InteractiveObject.hxx"
|
||||
#include "AIS_TypeOfAxis.hxx"
|
||||
#include "gp_Dir.hxx"
|
||||
#include "gp_Pnt.hxx"
|
||||
#include "SelectMgr_Selection.hxx"
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <AIS_TypeOfAxis.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <SelectMgr_Selection.hxx>
|
||||
|
||||
class Geom_Line;
|
||||
class Geom_Axis1Placement;
|
||||
@ -39,41 +39,41 @@ class AIS_Axis : public AIS_InteractiveObject
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_Axis, AIS_InteractiveObject)
|
||||
public:
|
||||
//! Initializes the line aComponent
|
||||
Standard_EXPORT AIS_Axis(const Handle(Geom_Line)& aComponent);
|
||||
Standard_EXPORT AIS_Axis(const occ::handle<Geom_Line>& aComponent);
|
||||
|
||||
//! initializes the axis2 position
|
||||
//! aComponent. The coordinate system used is right-handed.
|
||||
Standard_EXPORT AIS_Axis(const Handle(Geom_Axis2Placement)& aComponent,
|
||||
const AIS_TypeOfAxis anAxisType);
|
||||
Standard_EXPORT AIS_Axis(const occ::handle<Geom_Axis2Placement>& aComponent,
|
||||
const AIS_TypeOfAxis anAxisType);
|
||||
|
||||
//! Initializes the axis1 position anAxis.
|
||||
Standard_EXPORT AIS_Axis(const Handle(Geom_Axis1Placement)& anAxis);
|
||||
Standard_EXPORT AIS_Axis(const occ::handle<Geom_Axis1Placement>& anAxis);
|
||||
|
||||
//! Initializes the ray as axis with start point and direction
|
||||
//! @param[in] theAxis Start point and direction of the ray
|
||||
//! @param[in] theLength Optional length of the ray (ray is infinite by default).
|
||||
Standard_EXPORT AIS_Axis(const gp_Ax1& theAxis, const Standard_Real theLength = -1);
|
||||
Standard_EXPORT AIS_Axis(const gp_Ax1& theAxis, const double theLength = -1);
|
||||
|
||||
//! Returns the axis entity aComponent and identifies it
|
||||
//! as a component of a shape.
|
||||
const Handle(Geom_Line)& Component() const { return myComponent; }
|
||||
const occ::handle<Geom_Line>& Component() const { return myComponent; }
|
||||
|
||||
//! Sets the coordinates of the lin aComponent.
|
||||
Standard_EXPORT void SetComponent(const Handle(Geom_Line)& aComponent);
|
||||
Standard_EXPORT void SetComponent(const occ::handle<Geom_Line>& aComponent);
|
||||
|
||||
//! Returns the position of axis2 and positions it by
|
||||
//! Returns the position of axis2 and positions it by
|
||||
//! identifying it as the x, y, or z axis and giving its
|
||||
//! direction in 3D space. The coordinate system used is right-handed.
|
||||
const Handle(Geom_Axis2Placement)& Axis2Placement() const { return myAx2; }
|
||||
const occ::handle<Geom_Axis2Placement>& Axis2Placement() const { return myAx2; }
|
||||
|
||||
//! Allows you to provide settings for aComponent:the
|
||||
//! position and direction of an axis in 3D space. The
|
||||
//! coordinate system used is right-handed.
|
||||
Standard_EXPORT void SetAxis2Placement(const Handle(Geom_Axis2Placement)& aComponent,
|
||||
const AIS_TypeOfAxis anAxisType);
|
||||
Standard_EXPORT void SetAxis2Placement(const occ::handle<Geom_Axis2Placement>& aComponent,
|
||||
const AIS_TypeOfAxis anAxisType);
|
||||
|
||||
//! Constructs a new line to serve as the axis anAxis in 3D space.
|
||||
Standard_EXPORT void SetAxis1Placement(const Handle(Geom_Axis1Placement)& anAxis);
|
||||
Standard_EXPORT void SetAxis1Placement(const occ::handle<Geom_Axis1Placement>& anAxis);
|
||||
|
||||
//! Returns the type of axis.
|
||||
AIS_TypeOfAxis TypeOfAxis() const { return myTypeOfAxis; }
|
||||
@ -85,53 +85,47 @@ public:
|
||||
//! Returns a signature of 2 for axis datums. When you
|
||||
//! activate mode 2 by a signature, you pick AIS objects
|
||||
//! of type AIS_Axis.
|
||||
Standard_Boolean IsXYZAxis() const { return myIsXYZAxis; }
|
||||
bool IsXYZAxis() const { return myIsXYZAxis; }
|
||||
|
||||
//! Returns true if the interactive object accepts the display mode aMode.
|
||||
Standard_EXPORT Standard_Boolean
|
||||
AcceptDisplayMode(const Standard_Integer aMode) const Standard_OVERRIDE;
|
||||
Standard_EXPORT bool AcceptDisplayMode(const int aMode) const override;
|
||||
|
||||
virtual Standard_Integer Signature() const Standard_OVERRIDE { return 2; }
|
||||
int Signature() const override { return 2; }
|
||||
|
||||
virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE
|
||||
{
|
||||
return AIS_KindOfInteractive_Datum;
|
||||
}
|
||||
AIS_KindOfInteractive Type() const override { return AIS_KindOfInteractive_Datum; }
|
||||
|
||||
Standard_EXPORT void SetColor(const Quantity_Color& aColor) Standard_OVERRIDE;
|
||||
Standard_EXPORT void SetColor(const Quantity_Color& aColor) override;
|
||||
|
||||
Standard_EXPORT void SetWidth(const Standard_Real aValue) Standard_OVERRIDE;
|
||||
Standard_EXPORT void SetWidth(const double aValue) override;
|
||||
|
||||
//! Set required visualization parameters.
|
||||
Standard_EXPORT void SetDisplayAspect(const Handle(Prs3d_LineAspect)& theNewDatumAspect);
|
||||
Standard_EXPORT void SetDisplayAspect(const occ::handle<Prs3d_LineAspect>& theNewDatumAspect);
|
||||
|
||||
Standard_EXPORT void UnsetColor() Standard_OVERRIDE;
|
||||
Standard_EXPORT void UnsetColor() override;
|
||||
|
||||
Standard_EXPORT void UnsetWidth() Standard_OVERRIDE;
|
||||
Standard_EXPORT void UnsetWidth() override;
|
||||
|
||||
private:
|
||||
Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager)& thePrsMgr,
|
||||
const Handle(Prs3d_Presentation)& thePrs,
|
||||
const Standard_Integer theMode) Standard_OVERRIDE;
|
||||
Standard_EXPORT void Compute(const occ::handle<PrsMgr_PresentationManager>& thePrsMgr,
|
||||
const occ::handle<Prs3d_Presentation>& thePrs,
|
||||
const int theMode) override;
|
||||
|
||||
Standard_EXPORT virtual void ComputeSelection(const Handle(SelectMgr_Selection)& theSel,
|
||||
const Standard_Integer theMode) Standard_OVERRIDE;
|
||||
Standard_EXPORT void ComputeSelection(const occ::handle<SelectMgr_Selection>& theSel,
|
||||
const int theMode) override;
|
||||
|
||||
Standard_EXPORT void ComputeFields();
|
||||
|
||||
private:
|
||||
Handle(Geom_Line) myComponent;
|
||||
Handle(Geom_Axis2Placement) myAx2;
|
||||
gp_Pnt myPfirst;
|
||||
gp_Pnt myPlast;
|
||||
AIS_TypeOfAxis myTypeOfAxis;
|
||||
Standard_Boolean myIsXYZAxis;
|
||||
gp_Dir myDir;
|
||||
Standard_Real myVal;
|
||||
Standard_CString myText;
|
||||
Handle(Prs3d_LineAspect) myLineAspect;
|
||||
occ::handle<Geom_Line> myComponent;
|
||||
occ::handle<Geom_Axis2Placement> myAx2;
|
||||
gp_Pnt myPfirst;
|
||||
gp_Pnt myPlast;
|
||||
AIS_TypeOfAxis myTypeOfAxis;
|
||||
bool myIsXYZAxis;
|
||||
gp_Dir myDir;
|
||||
double myVal;
|
||||
const char* myText;
|
||||
occ::handle<Prs3d_LineAspect> myLineAspect;
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE(AIS_Axis, AIS_InteractiveObject)
|
||||
|
||||
#endif // _AIS_Axis_HeaderFile
|
||||
|
||||
@ -17,18 +17,17 @@
|
||||
#ifndef _AIS_BadEdgeFilter_HeaderFile
|
||||
#define _AIS_BadEdgeFilter_HeaderFile
|
||||
|
||||
#include "Standard.hxx"
|
||||
#include <Standard.hxx>
|
||||
|
||||
#include "TopTools_DataMapOfIntegerListOfShape.hxx"
|
||||
#include "Standard_Integer.hxx"
|
||||
#include "SelectMgr_Filter.hxx"
|
||||
#include "TopAbs_ShapeEnum.hxx"
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <NCollection_List.hxx>
|
||||
#include <NCollection_DataMap.hxx>
|
||||
#include <SelectMgr_Filter.hxx>
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
class SelectMgr_EntityOwner;
|
||||
class TopoDS_Edge;
|
||||
|
||||
class AIS_BadEdgeFilter;
|
||||
DEFINE_STANDARD_HANDLE(AIS_BadEdgeFilter, SelectMgr_Filter)
|
||||
|
||||
//! A Class
|
||||
class AIS_BadEdgeFilter : public SelectMgr_Filter
|
||||
{
|
||||
@ -37,30 +36,25 @@ public:
|
||||
//! Constructs an empty filter object for bad edges.
|
||||
Standard_EXPORT AIS_BadEdgeFilter();
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean ActsOn(const TopAbs_ShapeEnum aType) const
|
||||
Standard_OVERRIDE;
|
||||
Standard_EXPORT bool ActsOn(const TopAbs_ShapeEnum aType) const override;
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& EO) const
|
||||
Standard_OVERRIDE;
|
||||
Standard_EXPORT bool IsOk(const occ::handle<SelectMgr_EntityOwner>& EO) const override;
|
||||
|
||||
//! sets <myContour> with current contour. used by
|
||||
//! IsOk.
|
||||
Standard_EXPORT void SetContour(const Standard_Integer Index);
|
||||
//! sets <myContour> with current contour. used by IsOk.
|
||||
Standard_EXPORT void SetContour(const int Index);
|
||||
|
||||
//! Adds an edge to the list of non-selectionnable
|
||||
//! edges.
|
||||
Standard_EXPORT void AddEdge(const TopoDS_Edge& anEdge, const Standard_Integer Index);
|
||||
//! Adds an edge to the list of non-selectable edges.
|
||||
Standard_EXPORT void AddEdge(const TopoDS_Edge& anEdge, const int Index);
|
||||
|
||||
//! removes from the list of non-selectionnable edges
|
||||
//! removes from the list of non-selectable edges
|
||||
//! all edges in the contour <Index>.
|
||||
Standard_EXPORT void RemoveEdges(const Standard_Integer Index);
|
||||
Standard_EXPORT void RemoveEdges(const int Index);
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_BadEdgeFilter, SelectMgr_Filter)
|
||||
|
||||
protected:
|
||||
private:
|
||||
TopTools_DataMapOfIntegerListOfShape myBadEdges;
|
||||
Standard_Integer myContour;
|
||||
NCollection_DataMap<int, NCollection_List<TopoDS_Shape>> myBadEdges;
|
||||
int myContour;
|
||||
};
|
||||
|
||||
#endif // _AIS_BadEdgeFilter_HeaderFile
|
||||
|
||||
@ -14,8 +14,8 @@
|
||||
#ifndef _AIS_BaseAnimationObject_HeaderFile
|
||||
#define _AIS_BaseAnimationObject_HeaderFile
|
||||
|
||||
#include "AIS_Animation.hxx"
|
||||
#include "AIS_InteractiveContext.hxx"
|
||||
#include <AIS_Animation.hxx>
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
|
||||
//! Animation defining object transformation.
|
||||
class AIS_BaseAnimationObject : public AIS_Animation
|
||||
@ -26,9 +26,9 @@ protected:
|
||||
//! @param[in] theAnimationName animation identifier
|
||||
//! @param[in] theContext interactive context where object have been displayed
|
||||
//! @param[in] theObject object to apply local transformation
|
||||
Standard_EXPORT AIS_BaseAnimationObject(const TCollection_AsciiString& theAnimationName,
|
||||
const Handle(AIS_InteractiveContext)& theContext,
|
||||
const Handle(AIS_InteractiveObject)& theObject);
|
||||
Standard_EXPORT AIS_BaseAnimationObject(const TCollection_AsciiString& theAnimationName,
|
||||
const occ::handle<AIS_InteractiveContext>& theContext,
|
||||
const occ::handle<AIS_InteractiveObject>& theObject);
|
||||
|
||||
//! Update the transformation.
|
||||
Standard_EXPORT void updateTrsf(const gp_Trsf& theTrsf);
|
||||
@ -38,8 +38,8 @@ private:
|
||||
Standard_EXPORT void invalidateViewer();
|
||||
|
||||
protected:
|
||||
Handle(AIS_InteractiveContext) myContext; //!< context where object is displayed
|
||||
Handle(AIS_InteractiveObject) myObject; //!< presentation object to set location
|
||||
occ::handle<AIS_InteractiveContext> myContext; //!< context where object is displayed
|
||||
occ::handle<AIS_InteractiveObject> myObject; //!< presentation object to set location
|
||||
};
|
||||
|
||||
#endif // _AIS_BaseAnimationObject_HeaderFile
|
||||
|
||||
@ -17,34 +17,30 @@
|
||||
#ifndef _AIS_C0RegularityFilter_HeaderFile
|
||||
#define _AIS_C0RegularityFilter_HeaderFile
|
||||
|
||||
#include "Standard.hxx"
|
||||
#include <Standard.hxx>
|
||||
|
||||
#include "TopTools_MapOfShape.hxx"
|
||||
#include "SelectMgr_Filter.hxx"
|
||||
#include "TopAbs_ShapeEnum.hxx"
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopTools_ShapeMapHasher.hxx>
|
||||
#include <NCollection_Map.hxx>
|
||||
#include <SelectMgr_Filter.hxx>
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
class TopoDS_Shape;
|
||||
class SelectMgr_EntityOwner;
|
||||
|
||||
class AIS_C0RegularityFilter;
|
||||
DEFINE_STANDARD_HANDLE(AIS_C0RegularityFilter, SelectMgr_Filter)
|
||||
|
||||
class AIS_C0RegularityFilter : public SelectMgr_Filter
|
||||
{
|
||||
|
||||
public:
|
||||
Standard_EXPORT AIS_C0RegularityFilter(const TopoDS_Shape& aShape);
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean ActsOn(const TopAbs_ShapeEnum aType) const
|
||||
Standard_OVERRIDE;
|
||||
Standard_EXPORT bool ActsOn(const TopAbs_ShapeEnum aType) const override;
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& EO) const
|
||||
Standard_OVERRIDE;
|
||||
Standard_EXPORT bool IsOk(const occ::handle<SelectMgr_EntityOwner>& EO) const override;
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_C0RegularityFilter, SelectMgr_Filter)
|
||||
|
||||
protected:
|
||||
private:
|
||||
TopTools_MapOfShape myMapOfEdges;
|
||||
NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher> myMapOfEdges;
|
||||
};
|
||||
|
||||
#endif // _AIS_C0RegularityFilter_HeaderFile
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
#ifndef _AIS_CameraFrustum_HeaderFile
|
||||
#define _AIS_CameraFrustum_HeaderFile
|
||||
|
||||
#include "AIS_InteractiveObject.hxx"
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
|
||||
class Graphic3d_ArrayOfSegments;
|
||||
class Graphic3d_ArrayOfTriangles;
|
||||
@ -39,30 +39,29 @@ public:
|
||||
Standard_EXPORT AIS_CameraFrustum();
|
||||
|
||||
//! Sets camera frustum.
|
||||
Standard_EXPORT void SetCameraFrustum(const Handle(Graphic3d_Camera)& theCamera);
|
||||
Standard_EXPORT void SetCameraFrustum(const occ::handle<Graphic3d_Camera>& theCamera);
|
||||
|
||||
//! Setup custom color.
|
||||
Standard_EXPORT virtual void SetColor(const Quantity_Color& theColor) Standard_OVERRIDE;
|
||||
Standard_EXPORT void SetColor(const Quantity_Color& theColor) override;
|
||||
|
||||
//! Restore default color.
|
||||
Standard_EXPORT virtual void UnsetColor() Standard_OVERRIDE;
|
||||
Standard_EXPORT void UnsetColor() override;
|
||||
|
||||
//! Restore transparency setting.
|
||||
Standard_EXPORT virtual void UnsetTransparency() Standard_OVERRIDE;
|
||||
Standard_EXPORT void UnsetTransparency() override;
|
||||
|
||||
//! Return true if specified display mode is supported.
|
||||
Standard_EXPORT virtual Standard_Boolean AcceptDisplayMode(const Standard_Integer theMode) const
|
||||
Standard_OVERRIDE;
|
||||
Standard_EXPORT bool AcceptDisplayMode(const int theMode) const override;
|
||||
|
||||
protected:
|
||||
//! Computes presentation of camera frustum.
|
||||
Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager)& thePrsMgr,
|
||||
const Handle(Prs3d_Presentation)& thePrs,
|
||||
const Standard_Integer theMode) Standard_OVERRIDE;
|
||||
Standard_EXPORT void Compute(const occ::handle<PrsMgr_PresentationManager>& thePrsMgr,
|
||||
const occ::handle<Prs3d_Presentation>& thePrs,
|
||||
const int theMode) override;
|
||||
|
||||
//! Compute selection.
|
||||
Standard_EXPORT virtual void ComputeSelection(const Handle(SelectMgr_Selection)& theSelection,
|
||||
const Standard_Integer theMode) Standard_OVERRIDE;
|
||||
Standard_EXPORT void ComputeSelection(const occ::handle<SelectMgr_Selection>& theSelection,
|
||||
const int theMode) override;
|
||||
|
||||
private:
|
||||
//! Fills triangles primitive array for camera frustum filling.
|
||||
@ -72,9 +71,9 @@ private:
|
||||
void fillBorders();
|
||||
|
||||
protected:
|
||||
NCollection_Array1<Graphic3d_Vec3d> myPoints; //!< Array of points
|
||||
Handle(Graphic3d_ArrayOfTriangles) myTriangles; //!< Triangles for camera frustum filling
|
||||
Handle(Graphic3d_ArrayOfSegments) myBorders; //!< Segments for camera frustum borders
|
||||
NCollection_Array1<NCollection_Vec3<double>> myPoints; //!< Array of points
|
||||
occ::handle<Graphic3d_ArrayOfTriangles> myTriangles; //!< Triangles for camera frustum filling
|
||||
occ::handle<Graphic3d_ArrayOfSegments> myBorders; //!< Segments for camera frustum borders
|
||||
};
|
||||
|
||||
#endif // _AIS_CameraFrustum_HeaderFile
|
||||
|
||||
@ -1,22 +0,0 @@
|
||||
// Copyright (c) 2020 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _AIS_Chamf2dDimension_HeaderFile
|
||||
#define _AIS_Chamf2dDimension_HeaderFile
|
||||
|
||||
#include "PrsDim_Chamf2dDimension.hxx"
|
||||
|
||||
Standard_DEPRECATED("Alias to moved class")
|
||||
typedef PrsDim_Chamf2dDimension AIS_Chamf2dDimension;
|
||||
|
||||
#endif // _AIS_Chamf2dDimension_HeaderFile
|
||||
@ -1,22 +0,0 @@
|
||||
// Copyright (c) 2020 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _AIS_Chamf3dDimension_HeaderFile
|
||||
#define _AIS_Chamf3dDimension_HeaderFile
|
||||
|
||||
#include "PrsDim_Chamf3dDimension.hxx"
|
||||
|
||||
Standard_DEPRECATED("Alias to moved class")
|
||||
typedef PrsDim_Chamf3dDimension AIS_Chamf3dDimension;
|
||||
|
||||
#endif // _AIS_Chamf3dDimension_HeaderFile
|
||||
@ -17,7 +17,7 @@
|
||||
#ifndef _AIS_Circle_HeaderFile
|
||||
#define _AIS_Circle_HeaderFile
|
||||
|
||||
#include "AIS_InteractiveObject.hxx"
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
|
||||
class Geom_Circle;
|
||||
|
||||
@ -29,102 +29,97 @@ class AIS_Circle : public AIS_InteractiveObject
|
||||
public:
|
||||
//! Initializes this algorithm for constructing AIS circle
|
||||
//! datums initializes the circle aCircle
|
||||
Standard_EXPORT AIS_Circle(const Handle(Geom_Circle)& aCircle);
|
||||
Standard_EXPORT AIS_Circle(const occ::handle<Geom_Circle>& aCircle);
|
||||
|
||||
//! Initializes this algorithm for constructing AIS circle datums.
|
||||
//! Initializes the circle theCircle, the arc
|
||||
//! starting point theUStart, the arc ending point theUEnd,
|
||||
//! and the type of sensitivity theIsFilledCircleSens.
|
||||
Standard_EXPORT AIS_Circle(const Handle(Geom_Circle)& theCircle,
|
||||
const Standard_Real theUStart,
|
||||
const Standard_Real theUEnd,
|
||||
const Standard_Boolean theIsFilledCircleSens = Standard_False);
|
||||
Standard_EXPORT AIS_Circle(const occ::handle<Geom_Circle>& theCircle,
|
||||
const double theUStart,
|
||||
const double theUEnd,
|
||||
const bool theIsFilledCircleSens = false);
|
||||
|
||||
//! Returns index 6 by default.
|
||||
virtual Standard_Integer Signature() const Standard_OVERRIDE { return 6; }
|
||||
int Signature() const override { return 6; }
|
||||
|
||||
//! Indicates that the type of Interactive Object is a datum.
|
||||
virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE
|
||||
{
|
||||
return AIS_KindOfInteractive_Datum;
|
||||
}
|
||||
AIS_KindOfInteractive Type() const override { return AIS_KindOfInteractive_Datum; }
|
||||
|
||||
//! Returns the circle component defined in SetCircle.
|
||||
const Handle(Geom_Circle)& Circle() const { return myComponent; }
|
||||
const occ::handle<Geom_Circle>& Circle() const { return myComponent; }
|
||||
|
||||
//! Constructs instances of the starting point and the end
|
||||
//! point parameters, theU1 and theU2.
|
||||
void Parameters(Standard_Real& theU1, Standard_Real& theU2) const
|
||||
void Parameters(double& theU1, double& theU2) const
|
||||
{
|
||||
theU1 = myUStart;
|
||||
theU2 = myUEnd;
|
||||
}
|
||||
|
||||
//! Allows you to provide settings for the circle datum aCircle.
|
||||
void SetCircle(const Handle(Geom_Circle)& theCircle) { myComponent = theCircle; }
|
||||
void SetCircle(const occ::handle<Geom_Circle>& theCircle) { myComponent = theCircle; }
|
||||
|
||||
//! Allows you to set the parameter theU for the starting point of an arc.
|
||||
void SetFirstParam(const Standard_Real theU)
|
||||
void SetFirstParam(const double theU)
|
||||
{
|
||||
myUStart = theU;
|
||||
myCircleIsArc = Standard_True;
|
||||
myCircleIsArc = true;
|
||||
}
|
||||
|
||||
//! Allows you to provide the parameter theU for the end point of an arc.
|
||||
void SetLastParam(const Standard_Real theU)
|
||||
void SetLastParam(const double theU)
|
||||
{
|
||||
myUEnd = theU;
|
||||
myCircleIsArc = Standard_True;
|
||||
myCircleIsArc = true;
|
||||
}
|
||||
|
||||
Standard_EXPORT void SetColor(const Quantity_Color& aColor) Standard_OVERRIDE;
|
||||
Standard_EXPORT void SetColor(const Quantity_Color& aColor) override;
|
||||
|
||||
//! Assigns the width aValue to the solid line boundary of the circle datum.
|
||||
Standard_EXPORT void SetWidth(const Standard_Real aValue) Standard_OVERRIDE;
|
||||
Standard_EXPORT void SetWidth(const double aValue) override;
|
||||
|
||||
//! Removes color from the solid line boundary of the circle datum.
|
||||
Standard_EXPORT void UnsetColor() Standard_OVERRIDE;
|
||||
Standard_EXPORT void UnsetColor() override;
|
||||
|
||||
//! Removes width settings from the solid line boundary of the circle datum.
|
||||
Standard_EXPORT void UnsetWidth() Standard_OVERRIDE;
|
||||
Standard_EXPORT void UnsetWidth() override;
|
||||
|
||||
//! Returns the type of sensitivity for the circle;
|
||||
Standard_Boolean IsFilledCircleSens() const { return myIsFilledCircleSens; }
|
||||
bool IsFilledCircleSens() const { return myIsFilledCircleSens; }
|
||||
|
||||
//! Sets the type of sensitivity for the circle. If theIsFilledCircleSens set to Standard_True
|
||||
//! Sets the type of sensitivity for the circle. If theIsFilledCircleSens set to true
|
||||
//! then the whole circle will be detectable, otherwise only the boundary of the circle.
|
||||
void SetFilledCircleSens(const Standard_Boolean theIsFilledCircleSens)
|
||||
void SetFilledCircleSens(const bool theIsFilledCircleSens)
|
||||
{
|
||||
myIsFilledCircleSens = theIsFilledCircleSens;
|
||||
}
|
||||
|
||||
private:
|
||||
Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager)& thePrsMgr,
|
||||
const Handle(Prs3d_Presentation)& theprs,
|
||||
const Standard_Integer theMode) Standard_OVERRIDE;
|
||||
Standard_EXPORT void Compute(const occ::handle<PrsMgr_PresentationManager>& thePrsMgr,
|
||||
const occ::handle<Prs3d_Presentation>& theprs,
|
||||
const int theMode) override;
|
||||
|
||||
Standard_EXPORT virtual void ComputeSelection(const Handle(SelectMgr_Selection)& theSel,
|
||||
const Standard_Integer theMode) Standard_OVERRIDE;
|
||||
Standard_EXPORT void ComputeSelection(const occ::handle<SelectMgr_Selection>& theSel,
|
||||
const int theMode) override;
|
||||
|
||||
Standard_EXPORT void ComputeCircle(const Handle(Prs3d_Presentation)& aPresentation);
|
||||
Standard_EXPORT void ComputeCircle(const occ::handle<Prs3d_Presentation>& aPresentation);
|
||||
|
||||
Standard_EXPORT void ComputeArc(const Handle(Prs3d_Presentation)& aPresentation);
|
||||
Standard_EXPORT void ComputeArc(const occ::handle<Prs3d_Presentation>& aPresentation);
|
||||
|
||||
Standard_EXPORT void ComputeCircleSelection(const Handle(SelectMgr_Selection)& aSelection);
|
||||
Standard_EXPORT void ComputeCircleSelection(const occ::handle<SelectMgr_Selection>& aSelection);
|
||||
|
||||
Standard_EXPORT void ComputeArcSelection(const Handle(SelectMgr_Selection)& aSelection);
|
||||
Standard_EXPORT void ComputeArcSelection(const occ::handle<SelectMgr_Selection>& aSelection);
|
||||
|
||||
//! Replace aspects of already computed groups with the new value.
|
||||
void replaceWithNewLineAspect(const Handle(Prs3d_LineAspect)& theAspect);
|
||||
void replaceWithNewLineAspect(const occ::handle<Prs3d_LineAspect>& theAspect);
|
||||
|
||||
private:
|
||||
Handle(Geom_Circle) myComponent;
|
||||
Standard_Real myUStart;
|
||||
Standard_Real myUEnd;
|
||||
Standard_Boolean myCircleIsArc;
|
||||
Standard_Boolean myIsFilledCircleSens;
|
||||
occ::handle<Geom_Circle> myComponent;
|
||||
double myUStart;
|
||||
double myUEnd;
|
||||
bool myCircleIsArc;
|
||||
bool myIsFilledCircleSens;
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE(AIS_Circle, AIS_InteractiveObject)
|
||||
|
||||
#endif // _AIS_Circle_HeaderFile
|
||||
|
||||
@ -15,17 +15,14 @@
|
||||
#ifndef _AIS_ColorScale_HeaderFile
|
||||
#define _AIS_ColorScale_HeaderFile
|
||||
|
||||
#include "AIS_InteractiveObject.hxx"
|
||||
#include "Aspect_TypeOfColorScaleData.hxx"
|
||||
#include "Aspect_TypeOfColorScalePosition.hxx"
|
||||
#include "Aspect_SequenceOfColor.hxx"
|
||||
#include "Standard.hxx"
|
||||
#include "Standard_DefineHandle.hxx"
|
||||
#include "TCollection_ExtendedString.hxx"
|
||||
#include "TColStd_SequenceOfExtendedString.hxx"
|
||||
|
||||
class AIS_ColorScale;
|
||||
DEFINE_STANDARD_HANDLE(AIS_ColorScale, AIS_InteractiveObject)
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <Aspect_TypeOfColorScaleData.hxx>
|
||||
#include <Aspect_TypeOfColorScalePosition.hxx>
|
||||
#include <Quantity_Color.hxx>
|
||||
#include <NCollection_Sequence.hxx>
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineHandle.hxx>
|
||||
#include <TCollection_ExtendedString.hxx>
|
||||
|
||||
//! Class for drawing a custom color scale.
|
||||
//!
|
||||
@ -41,27 +38,27 @@ class AIS_ColorScale : public AIS_InteractiveObject
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_ColorScale, AIS_InteractiveObject)
|
||||
public:
|
||||
//! Calculate color according passed value; returns true if value is in range or false, if isn't
|
||||
Standard_EXPORT static Standard_Boolean FindColor(const Standard_Real theValue,
|
||||
const Standard_Real theMin,
|
||||
const Standard_Real theMax,
|
||||
const Standard_Integer theColorsCount,
|
||||
const Graphic3d_Vec3d& theColorHlsMin,
|
||||
const Graphic3d_Vec3d& theColorHlsMax,
|
||||
Quantity_Color& theColor);
|
||||
Standard_EXPORT static bool FindColor(const double theValue,
|
||||
const double theMin,
|
||||
const double theMax,
|
||||
const int theColorsCount,
|
||||
const NCollection_Vec3<double>& theColorHlsMin,
|
||||
const NCollection_Vec3<double>& theColorHlsMax,
|
||||
Quantity_Color& theColor);
|
||||
|
||||
//! Calculate color according passed value; returns true if value is in range or false, if isn't
|
||||
static Standard_Boolean FindColor(const Standard_Real theValue,
|
||||
const Standard_Real theMin,
|
||||
const Standard_Real theMax,
|
||||
const Standard_Integer theColorsCount,
|
||||
Quantity_Color& theColor)
|
||||
static bool FindColor(const double theValue,
|
||||
const double theMin,
|
||||
const double theMax,
|
||||
const int theColorsCount,
|
||||
Quantity_Color& theColor)
|
||||
{
|
||||
return FindColor(theValue,
|
||||
theMin,
|
||||
theMax,
|
||||
theColorsCount,
|
||||
Graphic3d_Vec3d(230.0, 1.0, 1.0),
|
||||
Graphic3d_Vec3d(0.0, 1.0, 1.0),
|
||||
NCollection_Vec3<double>(230.0, 1.0, 1.0),
|
||||
NCollection_Vec3<double>(0.0, 1.0, 1.0),
|
||||
theColor);
|
||||
}
|
||||
|
||||
@ -69,9 +66,9 @@ public:
|
||||
//! Lightness and Saturation should be specified in valid range [0.0, 1.0],
|
||||
//! however Hue might be given out of Quantity_Color range to specify desired range for
|
||||
//! interpolation.
|
||||
static Standard_Real hueToValidRange(const Standard_Real theHue)
|
||||
static double hueToValidRange(const double theHue)
|
||||
{
|
||||
Standard_Real aHue = theHue;
|
||||
double aHue = theHue;
|
||||
while (aHue < 0.0)
|
||||
{
|
||||
aHue += 360.0;
|
||||
@ -88,23 +85,22 @@ public:
|
||||
Standard_EXPORT AIS_ColorScale();
|
||||
|
||||
//! Calculate color according passed value; returns true if value is in range or false, if isn't
|
||||
Standard_EXPORT Standard_Boolean FindColor(const Standard_Real theValue,
|
||||
Quantity_Color& theColor) const;
|
||||
Standard_EXPORT bool FindColor(const double theValue, Quantity_Color& theColor) const;
|
||||
|
||||
//! Returns minimal value of color scale, 0.0 by default.
|
||||
Standard_Real GetMin() const { return myMin; }
|
||||
double GetMin() const { return myMin; }
|
||||
|
||||
//! Sets the minimal value of color scale.
|
||||
void SetMin(const Standard_Real theMin) { SetRange(theMin, GetMax()); }
|
||||
void SetMin(const double theMin) { SetRange(theMin, GetMax()); }
|
||||
|
||||
//! Returns maximal value of color scale, 1.0 by default.
|
||||
Standard_Real GetMax() const { return myMax; }
|
||||
double GetMax() const { return myMax; }
|
||||
|
||||
//! Sets the maximal value of color scale.
|
||||
void SetMax(const Standard_Real theMax) { SetRange(GetMin(), theMax); }
|
||||
void SetMax(const double theMax) { SetRange(GetMin(), theMax); }
|
||||
|
||||
//! Returns minimal and maximal values of color scale, 0.0 to 1.0 by default.
|
||||
void GetRange(Standard_Real& theMin, Standard_Real& theMax) const
|
||||
void GetRange(double& theMin, double& theMax) const
|
||||
{
|
||||
theMin = myMin;
|
||||
theMax = myMax;
|
||||
@ -114,17 +110,17 @@ public:
|
||||
//! Note that values order will be ignored - the minimum and maximum values will be swapped if
|
||||
//! needed.
|
||||
//! ::SetReversed() should be called to swap displaying order.
|
||||
Standard_EXPORT void SetRange(const Standard_Real theMin, const Standard_Real theMax);
|
||||
Standard_EXPORT void SetRange(const double theMin, const double theMax);
|
||||
|
||||
//! Returns the hue angle corresponding to minimum value, 230 by default (blue).
|
||||
Standard_Real HueMin() const { return myColorHlsMin[0]; }
|
||||
double HueMin() const { return myColorHlsMin[0]; }
|
||||
|
||||
//! Returns the hue angle corresponding to maximum value, 0 by default (red).
|
||||
Standard_Real HueMax() const { return myColorHlsMax[0]; }
|
||||
double HueMax() const { return myColorHlsMax[0]; }
|
||||
|
||||
//! Returns the hue angle range corresponding to minimum and maximum values, 230 to 0 by default
|
||||
//! (blue to red).
|
||||
void HueRange(Standard_Real& theMinAngle, Standard_Real& theMaxAngle) const
|
||||
void HueRange(double& theMinAngle, double& theMaxAngle) const
|
||||
{
|
||||
theMinAngle = myColorHlsMin[0];
|
||||
theMaxAngle = myColorHlsMax[0];
|
||||
@ -132,7 +128,7 @@ public:
|
||||
|
||||
//! Sets hue angle range corresponding to minimum and maximum values.
|
||||
//! The valid angle range is [0, 360], see Quantity_Color and Quantity_TOC_HLS for more details.
|
||||
void SetHueRange(const Standard_Real theMinAngle, const Standard_Real theMaxAngle)
|
||||
void SetHueRange(const double theMinAngle, const double theMaxAngle)
|
||||
{
|
||||
myColorHlsMin[0] = theMinAngle;
|
||||
myColorHlsMax[0] = theMaxAngle;
|
||||
@ -179,10 +175,10 @@ public:
|
||||
void SetColorType(const Aspect_TypeOfColorScaleData theType) { myColorType = theType; }
|
||||
|
||||
//! Returns the number of color scale intervals, 10 by default.
|
||||
Standard_Integer GetNumberOfIntervals() const { return myNbIntervals; }
|
||||
int GetNumberOfIntervals() const { return myNbIntervals; }
|
||||
|
||||
//! Sets the number of color scale intervals.
|
||||
Standard_EXPORT void SetNumberOfIntervals(const Standard_Integer theNum);
|
||||
Standard_EXPORT void SetNumberOfIntervals(const int theNum);
|
||||
|
||||
//! Returns the color scale title string, empty string by default.
|
||||
const TCollection_ExtendedString& GetTitle() const { return myTitle; }
|
||||
@ -205,25 +201,24 @@ public:
|
||||
//! Index is in range from 1 to GetNumberOfIntervals() or to
|
||||
//! GetNumberOfIntervals() + 1 if IsLabelAtBorder() is true.
|
||||
//! Returns empty string if label not defined.
|
||||
Standard_EXPORT TCollection_ExtendedString GetLabel(const Standard_Integer theIndex) const;
|
||||
Standard_EXPORT TCollection_ExtendedString GetLabel(const int theIndex) const;
|
||||
|
||||
//! Returns the user specified color from color map with index (starts at 1).
|
||||
//! Returns default color if index is out of range in color map.
|
||||
Standard_EXPORT Quantity_Color GetIntervalColor(const Standard_Integer theIndex) const;
|
||||
Standard_EXPORT Quantity_Color GetIntervalColor(const int theIndex) const;
|
||||
|
||||
//! Sets the color of the specified interval.
|
||||
//! Note that list is automatically resized to include specified index.
|
||||
//! @param theColor color value to set
|
||||
//! @param theIndex index in range [1, GetNumberOfIntervals()];
|
||||
//! appended to the end of list if -1 is specified
|
||||
Standard_EXPORT void SetIntervalColor(const Quantity_Color& theColor,
|
||||
const Standard_Integer theIndex);
|
||||
Standard_EXPORT void SetIntervalColor(const Quantity_Color& theColor, const int theIndex);
|
||||
|
||||
//! Returns the user specified labels.
|
||||
Standard_EXPORT void GetLabels(TColStd_SequenceOfExtendedString& theLabels) const;
|
||||
Standard_EXPORT void GetLabels(NCollection_Sequence<TCollection_ExtendedString>& theLabels) const;
|
||||
|
||||
//! Returns the user specified labels.
|
||||
const TColStd_SequenceOfExtendedString& Labels() const { return myLabels; }
|
||||
const NCollection_Sequence<TCollection_ExtendedString>& Labels() const { return myLabels; }
|
||||
|
||||
//! Sets the color scale labels.
|
||||
//! The length of the sequence should be equal to GetNumberOfIntervals() or to
|
||||
@ -231,25 +226,23 @@ public:
|
||||
//! much the number of intervals, then these labels will be considered as "free" and will be
|
||||
//! located at the virtual intervals corresponding to the number of labels (with flag
|
||||
//! IsLabelAtBorder() having the same effect as in normal case).
|
||||
Standard_EXPORT void SetLabels(const TColStd_SequenceOfExtendedString& theSeq);
|
||||
Standard_EXPORT void SetLabels(const NCollection_Sequence<TCollection_ExtendedString>& theSeq);
|
||||
|
||||
//! Returns the user specified colors.
|
||||
Standard_EXPORT void GetColors(Aspect_SequenceOfColor& theColors) const;
|
||||
Standard_EXPORT void GetColors(NCollection_Sequence<Quantity_Color>& theColors) const;
|
||||
|
||||
//! Returns the user specified colors.
|
||||
const Aspect_SequenceOfColor& GetColors() const { return myColors; }
|
||||
const NCollection_Sequence<Quantity_Color>& GetColors() const { return myColors; }
|
||||
|
||||
//! Sets the color scale colors.
|
||||
//! The length of the sequence should be equal to GetNumberOfIntervals().
|
||||
Standard_EXPORT void SetColors(const Aspect_SequenceOfColor& theSeq);
|
||||
Standard_EXPORT void SetColors(const NCollection_Sequence<Quantity_Color>& theSeq);
|
||||
|
||||
//! Populates colors scale by colors of the same lightness value in CIE Lch
|
||||
//! color space, distributed by hue, with perceptually uniform differences
|
||||
//! between consequent colors.
|
||||
//! See MakeUniformColors() for description of parameters.
|
||||
void SetUniformColors(Standard_Real theLightness,
|
||||
Standard_Real theHueFrom,
|
||||
Standard_Real theHueTo)
|
||||
void SetUniformColors(double theLightness, double theHueFrom, double theHueTo)
|
||||
{
|
||||
SetColors(MakeUniformColors(myNbIntervals, theLightness, theHueFrom, theHueTo));
|
||||
SetColorType(Aspect_TOCSD_USER);
|
||||
@ -270,10 +263,10 @@ public:
|
||||
//! Hue value can be out of the range [0, 360], interpreted as modulo 360.
|
||||
//! The colors of the scale will be in the order of increasing hue if
|
||||
//! theHueTo > theHueFrom, and decreasing otherwise.
|
||||
Standard_EXPORT static Aspect_SequenceOfColor MakeUniformColors(Standard_Integer theNbColors,
|
||||
Standard_Real theLightness,
|
||||
Standard_Real theHueFrom,
|
||||
Standard_Real theHueTo);
|
||||
Standard_EXPORT static NCollection_Sequence<Quantity_Color> MakeUniformColors(int theNbColors,
|
||||
double theLightness,
|
||||
double theHueFrom,
|
||||
double theHueTo);
|
||||
|
||||
//! Returns the position of labels concerning color filled rectangles, Aspect_TOCSP_RIGHT by
|
||||
//! default.
|
||||
@ -287,39 +280,38 @@ public:
|
||||
|
||||
//! Sets the color scale title position.
|
||||
Standard_DEPRECATED("AIS_ColorScale::SetTitlePosition() has no effect!")
|
||||
|
||||
void SetTitlePosition(const Aspect_TypeOfColorScalePosition thePos) { myTitlePos = thePos; }
|
||||
|
||||
//! Returns TRUE if the labels and colors used in reversed order, FALSE by default.
|
||||
//! - Normal, bottom-up order with Minimal value on the Bottom and Maximum value on Top.
|
||||
//! - Reversed, top-down order with Maximum value on the Bottom and Minimum value on Top.
|
||||
Standard_Boolean IsReversed() const { return myIsReversed; }
|
||||
bool IsReversed() const { return myIsReversed; }
|
||||
|
||||
//! Sets true if the labels and colors used in reversed order.
|
||||
void SetReversed(const Standard_Boolean theReverse) { myIsReversed = theReverse; }
|
||||
void SetReversed(const bool theReverse) { myIsReversed = theReverse; }
|
||||
|
||||
//! Return TRUE if color transition between neighbor intervals
|
||||
//! should be linearly interpolated, FALSE by default.
|
||||
Standard_Boolean IsSmoothTransition() const { return myIsSmooth; }
|
||||
bool IsSmoothTransition() const { return myIsSmooth; }
|
||||
|
||||
//! Setup smooth color transition.
|
||||
void SetSmoothTransition(const Standard_Boolean theIsSmooth) { myIsSmooth = theIsSmooth; }
|
||||
void SetSmoothTransition(const bool theIsSmooth) { myIsSmooth = theIsSmooth; }
|
||||
|
||||
//! Returns TRUE if the labels are placed at border of color intervals, TRUE by default.
|
||||
//! The automatically generated label will show value exactly on the current position:
|
||||
//! - value connecting two neighbor intervals (TRUE)
|
||||
//! - value in the middle of interval (FALSE)
|
||||
Standard_Boolean IsLabelAtBorder() const { return myIsLabelAtBorder; }
|
||||
bool IsLabelAtBorder() const { return myIsLabelAtBorder; }
|
||||
|
||||
//! Sets true if the labels are placed at border of color intervals (TRUE by default).
|
||||
//! If set to False, labels will be drawn at color intervals rather than at borders.
|
||||
void SetLabelAtBorder(const Standard_Boolean theOn) { myIsLabelAtBorder = theOn; }
|
||||
void SetLabelAtBorder(const bool theOn) { myIsLabelAtBorder = theOn; }
|
||||
|
||||
//! Returns TRUE if the color scale has logarithmic intervals, FALSE by default.
|
||||
Standard_Boolean IsLogarithmic() const { return myIsLogarithmic; }
|
||||
bool IsLogarithmic() const { return myIsLogarithmic; }
|
||||
|
||||
//! Sets true if the color scale has logarithmic intervals.
|
||||
void SetLogarithmic(const Standard_Boolean isLogarithmic) { myIsLogarithmic = isLogarithmic; }
|
||||
void SetLogarithmic(const bool isLogarithmic) { myIsLogarithmic = isLogarithmic; }
|
||||
|
||||
//! Sets the color scale label at index.
|
||||
//! Note that list is automatically resized to include specified index.
|
||||
@ -327,19 +319,18 @@ public:
|
||||
//! @param theIndex index in range [1, GetNumberOfIntervals()] or [1, GetNumberOfIntervals() + 1]
|
||||
//! if IsLabelAtBorder() is true;
|
||||
//! label is appended to the end of list if negative index is specified
|
||||
Standard_EXPORT void SetLabel(const TCollection_ExtendedString& theLabel,
|
||||
const Standard_Integer theIndex);
|
||||
Standard_EXPORT void SetLabel(const TCollection_ExtendedString& theLabel, const int theIndex);
|
||||
|
||||
//! Returns the size of color bar, 0 and 0 by default
|
||||
//! (e.g. should be set by user explicitly before displaying).
|
||||
void GetSize(Standard_Integer& theBreadth, Standard_Integer& theHeight) const
|
||||
void GetSize(int& theBreadth, int& theHeight) const
|
||||
{
|
||||
theBreadth = myBreadth;
|
||||
theHeight = myHeight;
|
||||
}
|
||||
|
||||
//! Sets the size of color bar.
|
||||
void SetSize(const Standard_Integer theBreadth, const Standard_Integer theHeight)
|
||||
void SetSize(const int theBreadth, const int theHeight)
|
||||
{
|
||||
myBreadth = theBreadth;
|
||||
myHeight = theHeight;
|
||||
@ -347,80 +338,77 @@ public:
|
||||
|
||||
//! Returns the breadth of color bar, 0 by default
|
||||
//! (e.g. should be set by user explicitly before displaying).
|
||||
Standard_Integer GetBreadth() const { return myBreadth; }
|
||||
int GetBreadth() const { return myBreadth; }
|
||||
|
||||
//! Sets the width of color bar.
|
||||
void SetBreadth(const Standard_Integer theBreadth) { myBreadth = theBreadth; }
|
||||
void SetBreadth(const int theBreadth) { myBreadth = theBreadth; }
|
||||
|
||||
//! Returns the height of color bar, 0 by default
|
||||
//! (e.g. should be set by user explicitly before displaying).
|
||||
Standard_Integer GetHeight() const { return myHeight; }
|
||||
int GetHeight() const { return myHeight; }
|
||||
|
||||
//! Sets the height of color bar.
|
||||
void SetHeight(const Standard_Integer theHeight) { myHeight = theHeight; }
|
||||
void SetHeight(const int theHeight) { myHeight = theHeight; }
|
||||
|
||||
//! Returns the bottom-left position of color scale, 0x0 by default.
|
||||
void GetPosition(Standard_Real& theX, Standard_Real& theY) const
|
||||
void GetPosition(double& theX, double& theY) const
|
||||
{
|
||||
theX = myXPos;
|
||||
theY = myYPos;
|
||||
}
|
||||
|
||||
//! Sets the position of color scale.
|
||||
void SetPosition(const Standard_Integer theX, const Standard_Integer theY)
|
||||
void SetPosition(const int theX, const int theY)
|
||||
{
|
||||
myXPos = theX;
|
||||
myYPos = theY;
|
||||
}
|
||||
|
||||
//! Returns the left position of color scale, 0 by default.
|
||||
Standard_Integer GetXPosition() const { return myXPos; }
|
||||
int GetXPosition() const { return myXPos; }
|
||||
|
||||
//! Sets the left position of color scale.
|
||||
void SetXPosition(const Standard_Integer theX) { myXPos = theX; }
|
||||
void SetXPosition(const int theX) { myXPos = theX; }
|
||||
|
||||
//! Returns the bottom position of color scale, 0 by default.
|
||||
Standard_Integer GetYPosition() const { return myYPos; }
|
||||
int GetYPosition() const { return myYPos; }
|
||||
|
||||
//! Sets the bottom position of color scale.
|
||||
void SetYPosition(const Standard_Integer theY) { myYPos = theY; }
|
||||
void SetYPosition(const int theY) { myYPos = theY; }
|
||||
|
||||
//! Returns the font height of text labels, 20 by default.
|
||||
Standard_Integer GetTextHeight() const { return myTextHeight; }
|
||||
int GetTextHeight() const { return myTextHeight; }
|
||||
|
||||
//! Sets the height of text of color scale.
|
||||
void SetTextHeight(const Standard_Integer theHeight) { myTextHeight = theHeight; }
|
||||
void SetTextHeight(const int theHeight) { myTextHeight = theHeight; }
|
||||
|
||||
public:
|
||||
//! Returns the width of text.
|
||||
//! @param[in] theText the text of which to calculate width.
|
||||
Standard_EXPORT Standard_Integer TextWidth(const TCollection_ExtendedString& theText) const;
|
||||
Standard_EXPORT int TextWidth(const TCollection_ExtendedString& theText) const;
|
||||
|
||||
//! Returns the height of text.
|
||||
//! @param[in] theText the text of which to calculate height.
|
||||
Standard_EXPORT Standard_Integer TextHeight(const TCollection_ExtendedString& theText) const;
|
||||
Standard_EXPORT int TextHeight(const TCollection_ExtendedString& theText) const;
|
||||
|
||||
Standard_EXPORT void TextSize(const TCollection_ExtendedString& theText,
|
||||
const Standard_Integer theHeight,
|
||||
Standard_Integer& theWidth,
|
||||
Standard_Integer& theAscent,
|
||||
Standard_Integer& theDescent) const;
|
||||
const int theHeight,
|
||||
int& theWidth,
|
||||
int& theAscent,
|
||||
int& theDescent) const;
|
||||
|
||||
public:
|
||||
//! Return true if specified display mode is supported.
|
||||
virtual Standard_Boolean AcceptDisplayMode(const Standard_Integer theMode) const Standard_OVERRIDE
|
||||
{
|
||||
return theMode == 0;
|
||||
}
|
||||
bool AcceptDisplayMode(const int theMode) const override { return theMode == 0; }
|
||||
|
||||
//! Compute presentation.
|
||||
Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager)& thePrsMgr,
|
||||
const Handle(Prs3d_Presentation)& thePresentation,
|
||||
const Standard_Integer theMode) Standard_OVERRIDE;
|
||||
Standard_EXPORT void Compute(const occ::handle<PrsMgr_PresentationManager>& thePrsMgr,
|
||||
const occ::handle<Prs3d_Presentation>& thePresentation,
|
||||
const int theMode) override;
|
||||
|
||||
//! Compute selection - not implemented for color scale.
|
||||
virtual void ComputeSelection(const Handle(SelectMgr_Selection)& /*aSelection*/,
|
||||
const Standard_Integer /*aMode*/) Standard_OVERRIDE
|
||||
void ComputeSelection(const occ::handle<SelectMgr_Selection>& /*aSelection*/,
|
||||
const int /*aMode*/) override
|
||||
{
|
||||
}
|
||||
|
||||
@ -428,18 +416,18 @@ private:
|
||||
//! Returns the size of color scale.
|
||||
//! @param[out] theWidth the width of color scale.
|
||||
//! @param[out] theHeight the height of color scale.
|
||||
void SizeHint(Standard_Integer& theWidth, Standard_Integer& theHeight) const;
|
||||
void SizeHint(int& theWidth, int& theHeight) const;
|
||||
|
||||
//! Returns the upper value of given interval, or minimum for theIndex = 0.
|
||||
Standard_Real GetIntervalValue(const Standard_Integer theIndex) const;
|
||||
double GetIntervalValue(const int theIndex) const;
|
||||
|
||||
//! Returns the color for the given value in the given interval.
|
||||
//! @param[in] theValue the current value of interval
|
||||
//! @param[in] theMin the min value of interval
|
||||
//! @param[in] theMax the max value of interval
|
||||
Quantity_Color colorFromValue(const Standard_Real theValue,
|
||||
const Standard_Real theMin,
|
||||
const Standard_Real theMax) const;
|
||||
Quantity_Color colorFromValue(const double theValue,
|
||||
const double theMin,
|
||||
const double theMax) const;
|
||||
|
||||
//! Initialize text aspect for drawing the labels.
|
||||
void updateTextAspect();
|
||||
@ -450,29 +438,29 @@ private:
|
||||
//! @param[in] theX X coordinate of text position
|
||||
//! @param[in] theY Y coordinate of text position
|
||||
//! @param[in] theVertAlignment text vertical alignment
|
||||
void drawText(const Handle(Graphic3d_Group)& theGroup,
|
||||
void drawText(const occ::handle<Graphic3d_Group>& theGroup,
|
||||
const TCollection_ExtendedString& theText,
|
||||
const Standard_Integer theX,
|
||||
const Standard_Integer theY,
|
||||
const int theX,
|
||||
const int theY,
|
||||
const Graphic3d_VerticalTextAlignment theVertAlignment);
|
||||
|
||||
//! Determine the maximum text label width in pixels.
|
||||
Standard_Integer computeMaxLabelWidth(const TColStd_SequenceOfExtendedString& theLabels) const;
|
||||
int computeMaxLabelWidth(const NCollection_Sequence<TCollection_ExtendedString>& theLabels) const;
|
||||
|
||||
//! Draw labels.
|
||||
void drawLabels(const Handle(Graphic3d_Group)& theGroup,
|
||||
const TColStd_SequenceOfExtendedString& theLabels,
|
||||
const Standard_Integer theBarBottom,
|
||||
const Standard_Integer theBarHeight,
|
||||
const Standard_Integer theMaxLabelWidth,
|
||||
const Standard_Integer theColorBreadth);
|
||||
void drawLabels(const occ::handle<Graphic3d_Group>& theGroup,
|
||||
const NCollection_Sequence<TCollection_ExtendedString>& theLabels,
|
||||
const int theBarBottom,
|
||||
const int theBarHeight,
|
||||
const int theMaxLabelWidth,
|
||||
const int theColorBreadth);
|
||||
|
||||
//! Draw a color bar.
|
||||
void drawColorBar(const Handle(Prs3d_Presentation)& thePrs,
|
||||
const Standard_Integer theBarBottom,
|
||||
const Standard_Integer theBarHeight,
|
||||
const Standard_Integer theMaxLabelWidth,
|
||||
const Standard_Integer theColorBreadth);
|
||||
void drawColorBar(const occ::handle<Prs3d_Presentation>& thePrs,
|
||||
const int theBarBottom,
|
||||
const int theBarHeight,
|
||||
const int theMaxLabelWidth,
|
||||
const int theColorBreadth);
|
||||
|
||||
//! Draw a frame.
|
||||
//! @param[in] theX the X coordinate of frame position.
|
||||
@ -480,39 +468,39 @@ private:
|
||||
//! @param[in] theWidth the width of frame.
|
||||
//! @param[in] theHeight the height of frame.
|
||||
//! @param[in] theColor the color of frame.
|
||||
void drawFrame(const Handle(Prs3d_Presentation)& thePrs,
|
||||
const Standard_Integer theX,
|
||||
const Standard_Integer theY,
|
||||
const Standard_Integer theWidth,
|
||||
const Standard_Integer theHeight,
|
||||
const Quantity_Color& theColor);
|
||||
void drawFrame(const occ::handle<Prs3d_Presentation>& thePrs,
|
||||
const int theX,
|
||||
const int theY,
|
||||
const int theWidth,
|
||||
const int theHeight,
|
||||
const Quantity_Color& theColor);
|
||||
|
||||
private:
|
||||
Standard_Real myMin; //!< values range - minimal value
|
||||
Standard_Real myMax; //!< values range - maximal value
|
||||
double myMin; //!< values range - minimal value
|
||||
double myMax; //!< values range - maximal value
|
||||
// clang-format off
|
||||
Graphic3d_Vec3d myColorHlsMin; //!< HLS color corresponding to minimum value
|
||||
Graphic3d_Vec3d myColorHlsMax; //!< HLS color corresponding to maximum value
|
||||
NCollection_Vec3<double> myColorHlsMin; //!< HLS color corresponding to minimum value
|
||||
NCollection_Vec3<double> myColorHlsMax; //!< HLS color corresponding to maximum value
|
||||
TCollection_ExtendedString myTitle; //!< optional title string
|
||||
TCollection_AsciiString myFormat; //!< sprintf() format for generating label from value
|
||||
Standard_Integer myNbIntervals; //!< number of intervals
|
||||
TCollection_AsciiString myFormat; //!< Sprintf() format for generating label from value
|
||||
int myNbIntervals; //!< number of intervals
|
||||
Aspect_TypeOfColorScaleData myColorType; //!< color type
|
||||
Aspect_TypeOfColorScaleData myLabelType; //!< label type
|
||||
Standard_Boolean myIsLabelAtBorder; //!< at border
|
||||
Standard_Boolean myIsReversed; //!< flag indicating reversed order
|
||||
Standard_Boolean myIsLogarithmic; //!< flag indicating logarithmic scale
|
||||
Standard_Boolean myIsSmooth; //!< flag indicating smooth transition between the colors
|
||||
Aspect_SequenceOfColor myColors; //!< sequence of custom colors
|
||||
TColStd_SequenceOfExtendedString myLabels; //!< sequence of custom text labels
|
||||
bool myIsLabelAtBorder; //!< at border
|
||||
bool myIsReversed; //!< flag indicating reversed order
|
||||
bool myIsLogarithmic; //!< flag indicating logarithmic scale
|
||||
bool myIsSmooth; //!< flag indicating smooth transition between the colors
|
||||
NCollection_Sequence<Quantity_Color> myColors; //!< sequence of custom colors
|
||||
NCollection_Sequence<TCollection_ExtendedString> myLabels; //!< sequence of custom text labels
|
||||
Aspect_TypeOfColorScalePosition myLabelPos; //!< label position relative to the color scale
|
||||
// clang-format on
|
||||
Aspect_TypeOfColorScalePosition myTitlePos; //!< title position
|
||||
Standard_Integer myXPos; //!< left position
|
||||
Standard_Integer myYPos; //!< bottom position
|
||||
Standard_Integer myBreadth; //!< color scale breadth
|
||||
Standard_Integer myHeight; //!< height of the color scale
|
||||
Standard_Integer mySpacing; //!< extra spacing between element
|
||||
Standard_Integer myTextHeight; //!< label font height
|
||||
int myXPos; //!< left position
|
||||
int myYPos; //!< bottom position
|
||||
int myBreadth; //!< color scale breadth
|
||||
int myHeight; //!< height of the color scale
|
||||
int mySpacing; //!< extra spacing between element
|
||||
int myTextHeight; //!< label font height
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@ -14,8 +14,8 @@
|
||||
#ifndef _AIS_ColoredDrawer_HeaderFile
|
||||
#define _AIS_ColoredDrawer_HeaderFile
|
||||
|
||||
#include "Prs3d_Drawer.hxx"
|
||||
#include "Quantity_Color.hxx"
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Quantity_Color.hxx>
|
||||
|
||||
//! Customizable properties.
|
||||
class AIS_ColoredDrawer : public Prs3d_Drawer
|
||||
@ -23,7 +23,7 @@ class AIS_ColoredDrawer : public Prs3d_Drawer
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_ColoredDrawer, Prs3d_Drawer)
|
||||
public:
|
||||
//! Default constructor.
|
||||
AIS_ColoredDrawer(const Handle(Prs3d_Drawer)& theLink)
|
||||
AIS_ColoredDrawer(const occ::handle<Prs3d_Drawer>& theLink)
|
||||
: myIsHidden(false),
|
||||
myHasOwnMaterial(false),
|
||||
myHasOwnColor(false),
|
||||
@ -53,13 +53,13 @@ public:
|
||||
|
||||
void UnsetOwnTransparency() { myHasOwnTransp = false; }
|
||||
|
||||
void SetOwnTransparency(Standard_Real /*theTransp*/) { myHasOwnTransp = true; }
|
||||
void SetOwnTransparency(double /*theTransp*/) { myHasOwnTransp = true; }
|
||||
|
||||
bool HasOwnWidth() const { return myHasOwnWidth; }
|
||||
|
||||
void UnsetOwnWidth() { myHasOwnWidth = false; }
|
||||
|
||||
void SetOwnWidth(const Standard_Real /*theWidth*/) { myHasOwnWidth = true; }
|
||||
void SetOwnWidth(const double /*theWidth*/) { myHasOwnWidth = true; }
|
||||
|
||||
public: //! @name list of overridden properties
|
||||
bool myIsHidden;
|
||||
@ -69,6 +69,4 @@ public: //! @name list of overridden properties
|
||||
bool myHasOwnWidth;
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE(AIS_ColoredDrawer, Prs3d_Drawer)
|
||||
|
||||
#endif // _AIS_ColoredDrawer_HeaderFile
|
||||
|
||||
@ -16,11 +16,14 @@
|
||||
#ifndef _AIS_ColoredShape_HeaderFile
|
||||
#define _AIS_ColoredShape_HeaderFile
|
||||
|
||||
#include "AIS_DataMapOfShapeDrawer.hxx"
|
||||
#include "AIS_Shape.hxx"
|
||||
#include "NCollection_IndexedDataMap.hxx"
|
||||
#include "TopoDS_Compound.hxx"
|
||||
#include "TopTools_MapOfShape.hxx"
|
||||
#include <AIS_ColoredDrawer.hxx>
|
||||
#include <NCollection_DataMap.hxx>
|
||||
#include <TopTools_ShapeMapHasher.hxx>
|
||||
#include <AIS_Shape.hxx>
|
||||
#include <NCollection_IndexedDataMap.hxx>
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <NCollection_Map.hxx>
|
||||
|
||||
class StdSelect_BRepOwner;
|
||||
|
||||
@ -32,72 +35,78 @@ public:
|
||||
Standard_EXPORT AIS_ColoredShape(const TopoDS_Shape& theShape);
|
||||
|
||||
//! Copy constructor
|
||||
Standard_EXPORT AIS_ColoredShape(const Handle(AIS_Shape)& theShape);
|
||||
Standard_EXPORT AIS_ColoredShape(const occ::handle<AIS_Shape>& theShape);
|
||||
|
||||
public: //! @name sub-shape aspects
|
||||
//! Customize properties of specified sub-shape.
|
||||
//! The shape will be stored in the map but ignored, if it is not sub-shape of main Shape!
|
||||
//! This method can be used to mark sub-shapes with customizable properties.
|
||||
Standard_EXPORT virtual Handle(AIS_ColoredDrawer) CustomAspects(const TopoDS_Shape& theShape);
|
||||
Standard_EXPORT virtual occ::handle<AIS_ColoredDrawer> CustomAspects(
|
||||
const TopoDS_Shape& theShape);
|
||||
|
||||
//! Reset the map of custom sub-shape aspects.
|
||||
Standard_EXPORT virtual void ClearCustomAspects();
|
||||
|
||||
//! Reset custom properties of specified sub-shape.
|
||||
//! @param theToUnregister unregister or not sub-shape from the map
|
||||
Standard_EXPORT void UnsetCustomAspects(const TopoDS_Shape& theShape,
|
||||
const Standard_Boolean theToUnregister = Standard_False);
|
||||
Standard_EXPORT void UnsetCustomAspects(const TopoDS_Shape& theShape,
|
||||
const bool theToUnregister = false);
|
||||
|
||||
//! Customize color of specified sub-shape
|
||||
Standard_EXPORT void SetCustomColor(const TopoDS_Shape& theShape, const Quantity_Color& theColor);
|
||||
|
||||
//! Customize transparency of specified sub-shape
|
||||
Standard_EXPORT void SetCustomTransparency(const TopoDS_Shape& theShape,
|
||||
Standard_Real theTransparency);
|
||||
Standard_EXPORT void SetCustomTransparency(const TopoDS_Shape& theShape, double theTransparency);
|
||||
|
||||
//! Customize line width of specified sub-shape
|
||||
Standard_EXPORT void SetCustomWidth(const TopoDS_Shape& theShape,
|
||||
const Standard_Real theLineWidth);
|
||||
Standard_EXPORT void SetCustomWidth(const TopoDS_Shape& theShape, const double theLineWidth);
|
||||
|
||||
//! Return the map of custom aspects.
|
||||
const AIS_DataMapOfShapeDrawer& CustomAspectsMap() const { return myShapeColors; }
|
||||
const NCollection_DataMap<TopoDS_Shape, occ::handle<AIS_ColoredDrawer>, TopTools_ShapeMapHasher>&
|
||||
CustomAspectsMap() const
|
||||
{
|
||||
return myShapeColors;
|
||||
}
|
||||
|
||||
//! Return the map of custom aspects.
|
||||
AIS_DataMapOfShapeDrawer& ChangeCustomAspectsMap() { return myShapeColors; }
|
||||
NCollection_DataMap<TopoDS_Shape, occ::handle<AIS_ColoredDrawer>, TopTools_ShapeMapHasher>&
|
||||
ChangeCustomAspectsMap()
|
||||
{
|
||||
return myShapeColors;
|
||||
}
|
||||
|
||||
public: //! @name global aspects
|
||||
//! Setup color of entire shape.
|
||||
Standard_EXPORT virtual void SetColor(const Quantity_Color& theColor) Standard_OVERRIDE;
|
||||
Standard_EXPORT void SetColor(const Quantity_Color& theColor) override;
|
||||
|
||||
//! Setup line width of entire shape.
|
||||
Standard_EXPORT virtual void SetWidth(const Standard_Real theLineWidth) Standard_OVERRIDE;
|
||||
Standard_EXPORT void SetWidth(const double theLineWidth) override;
|
||||
|
||||
//! Sets transparency value.
|
||||
Standard_EXPORT virtual void SetTransparency(const Standard_Real theValue) Standard_OVERRIDE;
|
||||
Standard_EXPORT void SetTransparency(const double theValue) override;
|
||||
|
||||
//! Sets the material aspect.
|
||||
Standard_EXPORT virtual void SetMaterial(const Graphic3d_MaterialAspect& theAspect)
|
||||
Standard_OVERRIDE;
|
||||
Standard_EXPORT void SetMaterial(const Graphic3d_MaterialAspect& theAspect) override;
|
||||
|
||||
public:
|
||||
//! Removes the setting for transparency in the reconstructed compound shape.
|
||||
Standard_EXPORT virtual void UnsetTransparency() Standard_OVERRIDE;
|
||||
Standard_EXPORT void UnsetTransparency() override;
|
||||
|
||||
//! Setup line width of entire shape.
|
||||
Standard_EXPORT virtual void UnsetWidth() Standard_OVERRIDE;
|
||||
Standard_EXPORT void UnsetWidth() override;
|
||||
|
||||
protected: //! @name override presentation computation
|
||||
//! Compute presentation considering sub-shape color map.
|
||||
Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager)& thePrsMgr,
|
||||
const Handle(Prs3d_Presentation)& thePrs,
|
||||
const Standard_Integer theMode) Standard_OVERRIDE;
|
||||
Standard_EXPORT void Compute(const occ::handle<PrsMgr_PresentationManager>& thePrsMgr,
|
||||
const occ::handle<Prs3d_Presentation>& thePrs,
|
||||
const int theMode) override;
|
||||
|
||||
//! Compute selection considering sub-shape hidden state.
|
||||
Standard_EXPORT virtual void ComputeSelection(const Handle(SelectMgr_Selection)& theSelection,
|
||||
const Standard_Integer theMode) Standard_OVERRIDE;
|
||||
Standard_EXPORT void ComputeSelection(const occ::handle<SelectMgr_Selection>& theSelection,
|
||||
const int theMode) override;
|
||||
|
||||
protected:
|
||||
typedef NCollection_IndexedDataMap<Handle(AIS_ColoredDrawer), TopoDS_Compound>
|
||||
typedef NCollection_IndexedDataMap<occ::handle<AIS_ColoredDrawer>, TopoDS_Compound>
|
||||
DataMapOfDrawerCompd;
|
||||
|
||||
protected:
|
||||
@ -109,20 +118,24 @@ protected:
|
||||
//! @param theIsParentClosed flag indicating that specified shape is part of closed Solid
|
||||
//! @param theDrawerOpenedShapePerType the array of shape types to fill
|
||||
//! @param theDrawerClosedFaces the map for closed faces
|
||||
Standard_EXPORT static Standard_Boolean dispatchColors(
|
||||
const Handle(AIS_ColoredDrawer)& theParentDrawer,
|
||||
const TopoDS_Shape& theShapeToParse,
|
||||
const AIS_DataMapOfShapeDrawer& theShapeDrawerMap,
|
||||
const TopAbs_ShapeEnum theParentType,
|
||||
const Standard_Boolean theIsParentClosed,
|
||||
DataMapOfDrawerCompd* theDrawerOpenedShapePerType,
|
||||
DataMapOfDrawerCompd& theDrawerClosedFaces);
|
||||
Standard_EXPORT static bool dispatchColors(
|
||||
const occ::handle<AIS_ColoredDrawer>& theParentDrawer,
|
||||
const TopoDS_Shape& theShapeToParse,
|
||||
const NCollection_DataMap<TopoDS_Shape,
|
||||
occ::handle<AIS_ColoredDrawer>,
|
||||
TopTools_ShapeMapHasher>& theShapeDrawerMap,
|
||||
const TopAbs_ShapeEnum theParentType,
|
||||
const bool theIsParentClosed,
|
||||
DataMapOfDrawerCompd* theDrawerOpenedShapePerType,
|
||||
DataMapOfDrawerCompd& theDrawerClosedFaces);
|
||||
|
||||
protected:
|
||||
//! Extract myShapeColors map (KeyshapeColored -> Color) to subshapes map (Subshape -> Color).
|
||||
//! This needed when colored shape is not part of BaseShape (but subshapes are) and actually
|
||||
//! container for subshapes.
|
||||
Standard_EXPORT void fillSubshapeDrawerMap(AIS_DataMapOfShapeDrawer& theSubshapeDrawerMap) const;
|
||||
Standard_EXPORT void fillSubshapeDrawerMap(
|
||||
NCollection_DataMap<TopoDS_Shape, occ::handle<AIS_ColoredDrawer>, TopTools_ShapeMapHasher>&
|
||||
theSubshapeDrawerMap) const;
|
||||
|
||||
//! Add shape to presentation
|
||||
//! @param thePrs the presentation
|
||||
@ -130,13 +143,13 @@ protected:
|
||||
//! @param theDrawerClosedFaces the map of attributes for closed faces
|
||||
//! @param theMode display mode
|
||||
Standard_EXPORT void addShapesWithCustomProps(
|
||||
const Handle(Prs3d_Presentation)& thePrs,
|
||||
const DataMapOfDrawerCompd* theDrawerOpenedShapePerType,
|
||||
const DataMapOfDrawerCompd& theDrawerClosedFaces,
|
||||
const Standard_Integer theMode);
|
||||
const occ::handle<Prs3d_Presentation>& thePrs,
|
||||
const DataMapOfDrawerCompd* theDrawerOpenedShapePerType,
|
||||
const DataMapOfDrawerCompd& theDrawerClosedFaces,
|
||||
const int theMode);
|
||||
|
||||
//! Check all shapes from myShapeColorsfor visibility
|
||||
Standard_EXPORT Standard_Boolean isShapeEntirelyVisible() const;
|
||||
Standard_EXPORT bool isShapeEntirelyVisible() const;
|
||||
|
||||
//! Resolve (parse) theKeyShape into subshapes, search in they for theBaseShape,
|
||||
//! bind all resolved subshapes with theOriginKeyShape and store all binds in theShapeDrawerMap
|
||||
@ -145,9 +158,11 @@ protected:
|
||||
//! @param theKeyShape a shape to be resolved (parse) into smaller (in topological sense)
|
||||
//! subshapes for new bind cycle
|
||||
//! @param theDrawer assigned drawer
|
||||
Standard_EXPORT void bindSubShapes(AIS_DataMapOfShapeDrawer& theShapeDrawerMap,
|
||||
const TopoDS_Shape& theKeyShape,
|
||||
const Handle(AIS_ColoredDrawer)& theDrawer) const;
|
||||
Standard_EXPORT void bindSubShapes(
|
||||
NCollection_DataMap<TopoDS_Shape, occ::handle<AIS_ColoredDrawer>, TopTools_ShapeMapHasher>&
|
||||
theShapeDrawerMap,
|
||||
const TopoDS_Shape& theKeyShape,
|
||||
const occ::handle<AIS_ColoredDrawer>& theDrawer) const;
|
||||
|
||||
//! Add sub-shape to selection considering hidden state (recursively).
|
||||
//! @param theParentDrawer drawer of parent shape
|
||||
@ -158,23 +173,25 @@ protected:
|
||||
//! @param theTypOfSel type of selection
|
||||
//! @param theDeflection linear deflection
|
||||
//! @param theDeflAngle angular deflection
|
||||
Standard_EXPORT void computeSubshapeSelection(const Handle(AIS_ColoredDrawer)& theParentDrawer,
|
||||
const AIS_DataMapOfShapeDrawer& theShapeDrawerMap,
|
||||
const TopoDS_Shape& theShape,
|
||||
const Handle(StdSelect_BRepOwner)& theOwner,
|
||||
const Handle(SelectMgr_Selection)& theSelection,
|
||||
const TopAbs_ShapeEnum theTypOfSel,
|
||||
const Standard_Integer thePriority,
|
||||
const Standard_Real theDeflection,
|
||||
const Standard_Real theDeflAngle);
|
||||
Standard_EXPORT void computeSubshapeSelection(
|
||||
const occ::handle<AIS_ColoredDrawer>& theParentDrawer,
|
||||
const NCollection_DataMap<TopoDS_Shape,
|
||||
occ::handle<AIS_ColoredDrawer>,
|
||||
TopTools_ShapeMapHasher>& theShapeDrawerMap,
|
||||
const TopoDS_Shape& theShape,
|
||||
const occ::handle<StdSelect_BRepOwner>& theOwner,
|
||||
const occ::handle<SelectMgr_Selection>& theSelection,
|
||||
const TopAbs_ShapeEnum theTypOfSel,
|
||||
const int thePriority,
|
||||
const double theDeflection,
|
||||
const double theDeflAngle);
|
||||
|
||||
protected:
|
||||
AIS_DataMapOfShapeDrawer myShapeColors;
|
||||
NCollection_DataMap<TopoDS_Shape, occ::handle<AIS_ColoredDrawer>, TopTools_ShapeMapHasher>
|
||||
myShapeColors;
|
||||
|
||||
public:
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_ColoredShape, AIS_Shape)
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE(AIS_ColoredShape, AIS_Shape)
|
||||
|
||||
#endif // _AIS_ColoredShape_HeaderFile
|
||||
|
||||
@ -1,22 +0,0 @@
|
||||
// Copyright (c) 2020 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _AIS_ConcentricRelation_HeaderFile
|
||||
#define _AIS_ConcentricRelation_HeaderFile
|
||||
|
||||
#include "PrsDim_ConcentricRelation.hxx"
|
||||
|
||||
Standard_DEPRECATED("Alias to moved class")
|
||||
typedef PrsDim_ConcentricRelation AIS_ConcentricRelation;
|
||||
|
||||
#endif // _AIS_ConcentricRelation_HeaderFile
|
||||
@ -17,9 +17,9 @@
|
||||
#ifndef _AIS_ConnectedInteractive_HeaderFile
|
||||
#define _AIS_ConnectedInteractive_HeaderFile
|
||||
|
||||
#include "AIS_InteractiveObject.hxx"
|
||||
#include "AIS_KindOfInteractive.hxx"
|
||||
#include "TopoDS_Shape.hxx"
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <AIS_KindOfInteractive.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
//! Creates an arbitrary located instance of another Interactive Object,
|
||||
//! which serves as a reference.
|
||||
@ -45,25 +45,22 @@ public:
|
||||
const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d = PrsMgr_TOP_AllView);
|
||||
|
||||
//! Returns KOI_Object
|
||||
virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE
|
||||
{
|
||||
return AIS_KindOfInteractive_Object;
|
||||
}
|
||||
AIS_KindOfInteractive Type() const override { return AIS_KindOfInteractive_Object; }
|
||||
|
||||
//! Returns 0
|
||||
virtual Standard_Integer Signature() const Standard_OVERRIDE { return 0; }
|
||||
int Signature() const override { return 0; }
|
||||
|
||||
//! Establishes the connection between the Connected
|
||||
//! Interactive Object, anotherIobj, and its reference.
|
||||
void Connect(const Handle(AIS_InteractiveObject)& theAnotherObj)
|
||||
void Connect(const occ::handle<AIS_InteractiveObject>& theAnotherObj)
|
||||
{
|
||||
connect(theAnotherObj, Handle(TopLoc_Datum3D)());
|
||||
connect(theAnotherObj, occ::handle<TopLoc_Datum3D>());
|
||||
}
|
||||
|
||||
//! Establishes the connection between the Connected
|
||||
//! Interactive Object, anotherIobj, and its reference.
|
||||
//! Locates instance in aLocation.
|
||||
void Connect(const Handle(AIS_InteractiveObject)& theAnotherObj, const gp_Trsf& theLocation)
|
||||
void Connect(const occ::handle<AIS_InteractiveObject>& theAnotherObj, const gp_Trsf& theLocation)
|
||||
{
|
||||
connect(theAnotherObj, new TopLoc_Datum3D(theLocation));
|
||||
}
|
||||
@ -71,18 +68,18 @@ public:
|
||||
//! Establishes the connection between the Connected
|
||||
//! Interactive Object, anotherIobj, and its reference.
|
||||
//! Locates instance in aLocation.
|
||||
void Connect(const Handle(AIS_InteractiveObject)& theAnotherObj,
|
||||
const Handle(TopLoc_Datum3D)& theLocation)
|
||||
void Connect(const occ::handle<AIS_InteractiveObject>& theAnotherObj,
|
||||
const occ::handle<TopLoc_Datum3D>& theLocation)
|
||||
{
|
||||
connect(theAnotherObj, theLocation);
|
||||
}
|
||||
|
||||
//! Returns true if there is a connection established
|
||||
//! between the presentation and its source reference.
|
||||
Standard_Boolean HasConnection() const { return !myReference.IsNull(); }
|
||||
bool HasConnection() const { return !myReference.IsNull(); }
|
||||
|
||||
//! Returns the connection with the reference Interactive Object.
|
||||
const Handle(AIS_InteractiveObject)& ConnectedTo() const { return myReference; }
|
||||
const occ::handle<AIS_InteractiveObject>& ConnectedTo() const { return myReference; }
|
||||
|
||||
//! Clears the connection with a source reference. The
|
||||
//! presentation will no longer be displayed.
|
||||
@ -91,13 +88,13 @@ public:
|
||||
|
||||
//! Informs the graphic context that the interactive Object
|
||||
//! may be decomposed into sub-shapes for dynamic selection.
|
||||
virtual Standard_Boolean AcceptShapeDecomposition() const Standard_OVERRIDE
|
||||
bool AcceptShapeDecomposition() const override
|
||||
{
|
||||
return !myReference.IsNull() && myReference->AcceptShapeDecomposition();
|
||||
}
|
||||
|
||||
//! Return true if reference presentation accepts specified display mode.
|
||||
virtual Standard_Boolean AcceptDisplayMode(const Standard_Integer theMode) const Standard_OVERRIDE
|
||||
bool AcceptDisplayMode(const int theMode) const override
|
||||
{
|
||||
return myReference.IsNull() || myReference->AcceptDisplayMode(theMode);
|
||||
}
|
||||
@ -112,38 +109,36 @@ protected:
|
||||
//! compute anything, but just uses the
|
||||
//! presentation of this last object, with
|
||||
//! a transformation if there's one stored.
|
||||
Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager)& thePrsMgr,
|
||||
const Handle(Prs3d_Presentation)& theprs,
|
||||
const Standard_Integer theMode) Standard_OVERRIDE;
|
||||
Standard_EXPORT void Compute(const occ::handle<PrsMgr_PresentationManager>& thePrsMgr,
|
||||
const occ::handle<Prs3d_Presentation>& theprs,
|
||||
const int theMode) override;
|
||||
|
||||
//! Computes the presentation according to a point of view.
|
||||
Standard_EXPORT virtual void computeHLR(const Handle(Graphic3d_Camera)& theProjector,
|
||||
const Handle(TopLoc_Datum3D)& theTrsf,
|
||||
const Handle(Prs3d_Presentation)& thePrs)
|
||||
Standard_OVERRIDE;
|
||||
Standard_EXPORT void computeHLR(const occ::handle<Graphic3d_Camera>& theProjector,
|
||||
const occ::handle<TopLoc_Datum3D>& theTrsf,
|
||||
const occ::handle<Prs3d_Presentation>& thePrs) override;
|
||||
|
||||
//! Generates sensitive entities by copying
|
||||
//! them from myReference selection, creates and sets an entity
|
||||
//! owner for this entities and adds them to theSelection
|
||||
Standard_EXPORT virtual void ComputeSelection(const Handle(SelectMgr_Selection)& theSelection,
|
||||
const Standard_Integer theMode) Standard_OVERRIDE;
|
||||
Standard_EXPORT void ComputeSelection(const occ::handle<SelectMgr_Selection>& theSelection,
|
||||
const int theMode) override;
|
||||
|
||||
//! Generates sensitive entities by copying
|
||||
//! them from myReference sub shapes selection, creates and sets an entity
|
||||
//! owner for this entities and adds them to theSelection
|
||||
Standard_EXPORT void computeSubShapeSelection(const Handle(SelectMgr_Selection)& theSelection,
|
||||
const Standard_Integer theMode);
|
||||
Standard_EXPORT void computeSubShapeSelection(
|
||||
const occ::handle<SelectMgr_Selection>& theSelection,
|
||||
const int theMode);
|
||||
|
||||
Standard_EXPORT void updateShape(const Standard_Boolean WithLocation = Standard_True);
|
||||
Standard_EXPORT void updateShape(const bool WithLocation = true);
|
||||
|
||||
Standard_EXPORT void connect(const Handle(AIS_InteractiveObject)& theAnotherObj,
|
||||
const Handle(TopLoc_Datum3D)& theLocation);
|
||||
Standard_EXPORT void connect(const occ::handle<AIS_InteractiveObject>& theAnotherObj,
|
||||
const occ::handle<TopLoc_Datum3D>& theLocation);
|
||||
|
||||
protected:
|
||||
Handle(AIS_InteractiveObject) myReference;
|
||||
TopoDS_Shape myShape;
|
||||
occ::handle<AIS_InteractiveObject> myReference;
|
||||
TopoDS_Shape myShape;
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE(AIS_ConnectedInteractive, AIS_InteractiveObject)
|
||||
|
||||
#endif // _AIS_ConnectedInteractive_HeaderFile
|
||||
|
||||
@ -1,19 +0,0 @@
|
||||
// Copyright (c) 2015 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef AIS_DataMapIteratorOfDataMapOfIOStatus_HeaderFile
|
||||
#define AIS_DataMapIteratorOfDataMapOfIOStatus_HeaderFile
|
||||
|
||||
#include "AIS_DataMapOfIOStatus.hxx"
|
||||
|
||||
#endif
|
||||
@ -1,7 +1,4 @@
|
||||
// Created on: 1996-12-11
|
||||
// Created by: Robert COUBLANC
|
||||
// Copyright (c) 1996-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
// Copyright (c) 2025 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
@ -14,16 +11,33 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef AIS_DataMapOfIOStatus_HeaderFile
|
||||
#define AIS_DataMapOfIOStatus_HeaderFile
|
||||
//! @file AIS_DataMapOfIOStatus.hxx
|
||||
//! @brief Deprecated typedef for backward compatibility.
|
||||
//! @deprecated This header is deprecated since OCCT 8.0.0.
|
||||
//! Use NCollection types directly instead.
|
||||
|
||||
#include "AIS_InteractiveObject.hxx"
|
||||
#include "AIS_GlobalStatus.hxx"
|
||||
#include "NCollection_DataMap.hxx"
|
||||
#ifndef _AIS_DataMapOfIOStatus_hxx
|
||||
#define _AIS_DataMapOfIOStatus_hxx
|
||||
|
||||
typedef NCollection_DataMap<Handle(AIS_InteractiveObject), Handle(AIS_GlobalStatus)>
|
||||
#include <Standard_Macro.hxx>
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <AIS_GlobalStatus.hxx>
|
||||
#include <NCollection_DataMap.hxx>
|
||||
|
||||
Standard_HEADER_DEPRECATED(
|
||||
"AIS_DataMapOfIOStatus.hxx is deprecated since OCCT 8.0.0. Use NCollection types directly.")
|
||||
|
||||
Standard_DEPRECATED("AIS_DataMapOfIOStatus is deprecated, use "
|
||||
"NCollection_DataMap<opencascade::handle<AIS_InteractiveObject>, "
|
||||
"opencascade::handle<AIS_GlobalStatus>> directly")
|
||||
typedef NCollection_DataMap<opencascade::handle<AIS_InteractiveObject>,
|
||||
opencascade::handle<AIS_GlobalStatus>>
|
||||
AIS_DataMapOfIOStatus;
|
||||
typedef NCollection_DataMap<Handle(AIS_InteractiveObject), Handle(AIS_GlobalStatus)>::Iterator
|
||||
Standard_DEPRECATED("AIS_DataMapIteratorOfDataMapOfIOStatus is deprecated, use "
|
||||
"NCollection_DataMap<opencascade::handle<AIS_InteractiveObject>, "
|
||||
"opencascade::handle<AIS_GlobalStatus>>::Iterator directly")
|
||||
typedef NCollection_DataMap<opencascade::handle<AIS_InteractiveObject>,
|
||||
opencascade::handle<AIS_GlobalStatus>>::Iterator
|
||||
AIS_DataMapIteratorOfDataMapOfIOStatus;
|
||||
|
||||
#endif
|
||||
#endif // _AIS_DataMapOfIOStatus_hxx
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2016 OPEN CASCADE SAS
|
||||
// Copyright (c) 2025 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
@ -11,14 +11,31 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _AIS_DataMapOfShapeDrawer_HeaderFile
|
||||
#define _AIS_DataMapOfShapeDrawer_HeaderFile
|
||||
//! @file AIS_DataMapOfShapeDrawer.hxx
|
||||
//! @brief Deprecated typedef for backward compatibility.
|
||||
//! @deprecated This header is deprecated since OCCT 8.0.0.
|
||||
//! Use NCollection_DataMap<TopoDS_Shape, opencascade::handle<AIS_ColoredDrawer>,
|
||||
//! TopTools_ShapeMapHasher> directly instead.
|
||||
|
||||
#include "AIS_ColoredDrawer.hxx"
|
||||
#include "NCollection_DataMap.hxx"
|
||||
#include "TopTools_ShapeMapHasher.hxx"
|
||||
#ifndef _AIS_DataMapOfShapeDrawer_hxx
|
||||
#define _AIS_DataMapOfShapeDrawer_hxx
|
||||
|
||||
typedef NCollection_DataMap<TopoDS_Shape, Handle(AIS_ColoredDrawer), TopTools_ShapeMapHasher>
|
||||
#include <Standard_Macro.hxx>
|
||||
#include <AIS_ColoredDrawer.hxx>
|
||||
#include <NCollection_DataMap.hxx>
|
||||
#include <TopTools_ShapeMapHasher.hxx>
|
||||
|
||||
Standard_HEADER_DEPRECATED(
|
||||
"AIS_DataMapOfShapeDrawer.hxx is deprecated since OCCT 8.0.0. Use "
|
||||
"NCollection_DataMap<TopoDS_Shape, opencascade::handle<AIS_ColoredDrawer>, "
|
||||
"TopTools_ShapeMapHasher> directly.")
|
||||
|
||||
Standard_DEPRECATED(
|
||||
"AIS_DataMapOfShapeDrawer is deprecated, use NCollection_DataMap<TopoDS_Shape, "
|
||||
"opencascade::handle<AIS_ColoredDrawer>, TopTools_ShapeMapHasher> directly")
|
||||
typedef NCollection_DataMap<TopoDS_Shape,
|
||||
opencascade::handle<AIS_ColoredDrawer>,
|
||||
TopTools_ShapeMapHasher>
|
||||
AIS_DataMapOfShapeDrawer;
|
||||
|
||||
#endif // _AIS_DataMapOfShapeDrawer_HeaderFile
|
||||
#endif // _AIS_DataMapOfShapeDrawer_hxx
|
||||
|
||||
@ -1,22 +0,0 @@
|
||||
// Copyright (c) 2020 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _AIS_DiameterDimension_HeaderFile
|
||||
#define _AIS_DiameterDimension_HeaderFile
|
||||
|
||||
#include "PrsDim_DiameterDimension.hxx"
|
||||
|
||||
Standard_DEPRECATED("Alias to moved class")
|
||||
typedef PrsDim_DiameterDimension AIS_DiameterDimension;
|
||||
|
||||
#endif // _AIS_DiameterDimension_HeaderFile
|
||||
@ -1,22 +0,0 @@
|
||||
// Copyright (c) 2020 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _AIS_Dimension_HeaderFile
|
||||
#define _AIS_Dimension_HeaderFile
|
||||
|
||||
#include "PrsDim_Dimension.hxx"
|
||||
|
||||
Standard_DEPRECATED("Alias to moved class")
|
||||
typedef PrsDim_Dimension AIS_Dimension;
|
||||
|
||||
#endif // _AIS_Dimension_HeaderFile
|
||||
@ -1,22 +0,0 @@
|
||||
// Copyright (c) 2020 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _AIS_DimensionOwner_HeaderFile
|
||||
#define _AIS_DimensionOwner_HeaderFile
|
||||
|
||||
#include "PrsDim_DimensionOwner.hxx"
|
||||
|
||||
Standard_DEPRECATED("Alias to moved class")
|
||||
typedef PrsDim_DimensionOwner AIS_DimensionOwner;
|
||||
|
||||
#endif // _AIS_DimensionOwner_HeaderFile
|
||||
@ -17,7 +17,7 @@
|
||||
#ifndef _AIS_DisplayStatus_HeaderFile
|
||||
#define _AIS_DisplayStatus_HeaderFile
|
||||
|
||||
#include "PrsMgr_DisplayStatus.hxx"
|
||||
#include <PrsMgr_DisplayStatus.hxx>
|
||||
|
||||
//! To give the display status of an Interactive Object.
|
||||
typedef PrsMgr_DisplayStatus AIS_DisplayStatus;
|
||||
|
||||
@ -1,22 +0,0 @@
|
||||
// Copyright (c) 2020 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _AIS_EllipseRadiusDimension_HeaderFile
|
||||
#define _AIS_EllipseRadiusDimension_HeaderFile
|
||||
|
||||
#include "PrsDim_EllipseRadiusDimension.hxx"
|
||||
|
||||
Standard_DEPRECATED("Alias to moved class")
|
||||
typedef PrsDim_EllipseRadiusDimension AIS_EllipseRadiusDimension;
|
||||
|
||||
#endif // _AIS_EllipseRadiusDimension_HeaderFile
|
||||
@ -1,22 +0,0 @@
|
||||
// Copyright (c) 2020 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _AIS_EqualDistanceRelation_HeaderFile
|
||||
#define _AIS_EqualDistanceRelation_HeaderFile
|
||||
|
||||
#include "PrsDim_EqualDistanceRelation.hxx"
|
||||
|
||||
Standard_DEPRECATED("Deprecated alias to moved class")
|
||||
typedef PrsDim_EqualDistanceRelation AIS_EqualDistanceRelation;
|
||||
|
||||
#endif // _AIS_EqualDistanceRelation_HeaderFile
|
||||
@ -1,22 +0,0 @@
|
||||
// Copyright (c) 2020 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _AIS_EqualRadiusRelation_HeaderFile
|
||||
#define _AIS_EqualRadiusRelation_HeaderFile
|
||||
|
||||
#include "PrsDim_EqualRadiusRelation.hxx"
|
||||
|
||||
Standard_DEPRECATED("Deprecated alias to moved class")
|
||||
typedef PrsDim_EqualRadiusRelation AIS_EqualRadiusRelation;
|
||||
|
||||
#endif // _AIS_EqualRadiusRelation_HeaderFile
|
||||
@ -17,19 +17,16 @@
|
||||
#ifndef _AIS_ExclusionFilter_HeaderFile
|
||||
#define _AIS_ExclusionFilter_HeaderFile
|
||||
|
||||
#include "Standard.hxx"
|
||||
#include "Standard_Type.hxx"
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include "TColStd_DataMapOfIntegerListOfInteger.hxx"
|
||||
#include "SelectMgr_Filter.hxx"
|
||||
#include "AIS_KindOfInteractive.hxx"
|
||||
#include "Standard_Integer.hxx"
|
||||
#include "TColStd_ListOfInteger.hxx"
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <NCollection_List.hxx>
|
||||
#include <NCollection_DataMap.hxx>
|
||||
#include <SelectMgr_Filter.hxx>
|
||||
#include <AIS_KindOfInteractive.hxx>
|
||||
class SelectMgr_EntityOwner;
|
||||
|
||||
class AIS_ExclusionFilter;
|
||||
DEFINE_STANDARD_HANDLE(AIS_ExclusionFilter, SelectMgr_Filter)
|
||||
|
||||
//! A framework to reject or to accept only objects of
|
||||
//! given types and/or signatures.
|
||||
//! Objects are stored, and the stored objects - along
|
||||
@ -51,56 +48,52 @@ public:
|
||||
//! Constructs an empty exclusion filter object defined by
|
||||
//! the flag setting ExclusionFlagOn.
|
||||
//! By default, the flag is set to true.
|
||||
Standard_EXPORT AIS_ExclusionFilter(const Standard_Boolean ExclusionFlagOn = Standard_True);
|
||||
Standard_EXPORT AIS_ExclusionFilter(const bool ExclusionFlagOn = true);
|
||||
|
||||
//! All the AIS objects of <TypeToExclude>
|
||||
//! Will be rejected by the IsOk Method.
|
||||
Standard_EXPORT AIS_ExclusionFilter(const AIS_KindOfInteractive TypeToExclude,
|
||||
const Standard_Boolean ExclusionFlagOn = Standard_True);
|
||||
const bool ExclusionFlagOn = true);
|
||||
|
||||
//! Constructs an exclusion filter object defined by the
|
||||
//! enumeration value TypeToExclude, the signature
|
||||
//! SignatureInType, and the flag setting ExclusionFlagOn.
|
||||
//! By default, the flag is set to true.
|
||||
Standard_EXPORT AIS_ExclusionFilter(const AIS_KindOfInteractive TypeToExclude,
|
||||
const Standard_Integer SignatureInType,
|
||||
const Standard_Boolean ExclusionFlagOn = Standard_True);
|
||||
const int SignatureInType,
|
||||
const bool ExclusionFlagOn = true);
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& anObj) const
|
||||
Standard_OVERRIDE;
|
||||
Standard_EXPORT bool IsOk(const occ::handle<SelectMgr_EntityOwner>& anObj) const override;
|
||||
|
||||
//! Adds the type TypeToExclude to the list of types.
|
||||
Standard_EXPORT Standard_Boolean Add(const AIS_KindOfInteractive TypeToExclude);
|
||||
Standard_EXPORT bool Add(const AIS_KindOfInteractive TypeToExclude);
|
||||
|
||||
Standard_EXPORT Standard_Boolean Add(const AIS_KindOfInteractive TypeToExclude,
|
||||
const Standard_Integer SignatureInType);
|
||||
Standard_EXPORT bool Add(const AIS_KindOfInteractive TypeToExclude, const int SignatureInType);
|
||||
|
||||
Standard_EXPORT Standard_Boolean Remove(const AIS_KindOfInteractive TypeToExclude);
|
||||
Standard_EXPORT bool Remove(const AIS_KindOfInteractive TypeToExclude);
|
||||
|
||||
Standard_EXPORT Standard_Boolean Remove(const AIS_KindOfInteractive TypeToExclude,
|
||||
const Standard_Integer SignatureInType);
|
||||
Standard_EXPORT bool Remove(const AIS_KindOfInteractive TypeToExclude, const int SignatureInType);
|
||||
|
||||
Standard_EXPORT void Clear();
|
||||
|
||||
Standard_Boolean IsExclusionFlagOn() const { return myIsExclusionFlagOn; }
|
||||
bool IsExclusionFlagOn() const { return myIsExclusionFlagOn; }
|
||||
|
||||
void SetExclusionFlag(const Standard_Boolean theStatus) { myIsExclusionFlagOn = theStatus; }
|
||||
void SetExclusionFlag(const bool theStatus) { myIsExclusionFlagOn = theStatus; }
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsStored(const AIS_KindOfInteractive aType) const;
|
||||
Standard_EXPORT bool IsStored(const AIS_KindOfInteractive aType) const;
|
||||
|
||||
Standard_EXPORT void ListOfStoredTypes(TColStd_ListOfInteger& TheList) const;
|
||||
Standard_EXPORT void ListOfStoredTypes(NCollection_List<int>& TheList) const;
|
||||
|
||||
Standard_EXPORT void ListOfSignature(const AIS_KindOfInteractive aType,
|
||||
TColStd_ListOfInteger& TheStoredList) const;
|
||||
NCollection_List<int>& TheStoredList) const;
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_ExclusionFilter, SelectMgr_Filter)
|
||||
|
||||
private:
|
||||
Standard_EXPORT Standard_Boolean IsSignatureIn(const AIS_KindOfInteractive aType,
|
||||
const Standard_Integer aSignature) const;
|
||||
Standard_EXPORT bool IsSignatureIn(const AIS_KindOfInteractive aType, const int aSignature) const;
|
||||
|
||||
Standard_Boolean myIsExclusionFlagOn;
|
||||
TColStd_DataMapOfIntegerListOfInteger myStoredTypes;
|
||||
bool myIsExclusionFlagOn;
|
||||
NCollection_DataMap<int, NCollection_List<int>> myStoredTypes;
|
||||
};
|
||||
|
||||
#endif // _AIS_ExclusionFilter_HeaderFile
|
||||
|
||||
@ -1,22 +0,0 @@
|
||||
// Copyright (c) 2020 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _AIS_FixRelation_HeaderFile
|
||||
#define _AIS_FixRelation_HeaderFile
|
||||
|
||||
#include "PrsDim_FixRelation.hxx"
|
||||
|
||||
Standard_DEPRECATED("Deprecated alias to moved class")
|
||||
typedef PrsDim_FixRelation AIS_FixRelation;
|
||||
|
||||
#endif // _AIS_FixRelation_HeaderFile
|
||||
@ -17,14 +17,12 @@
|
||||
#ifndef _AIS_GlobalStatus_HeaderFile
|
||||
#define _AIS_GlobalStatus_HeaderFile
|
||||
|
||||
#include "Standard.hxx"
|
||||
#include <Standard.hxx>
|
||||
|
||||
#include "Prs3d_Drawer.hxx"
|
||||
#include "TColStd_ListOfInteger.hxx"
|
||||
#include "Standard_Integer.hxx"
|
||||
#include "Standard_Transient.hxx"
|
||||
|
||||
DEFINE_STANDARD_HANDLE(AIS_GlobalStatus, Standard_Transient)
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <NCollection_List.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
|
||||
//! Stores information about objects in graphic context:
|
||||
class AIS_GlobalStatus : public Standard_Transient
|
||||
@ -35,62 +33,56 @@ public:
|
||||
Standard_EXPORT AIS_GlobalStatus();
|
||||
|
||||
//! Returns the display mode.
|
||||
Standard_Integer DisplayMode() const { return myDispMode; }
|
||||
int DisplayMode() const { return myDispMode; }
|
||||
|
||||
//! Sets display mode.
|
||||
void SetDisplayMode(const Standard_Integer theMode) { myDispMode = theMode; }
|
||||
void SetDisplayMode(const int theMode) { myDispMode = theMode; }
|
||||
|
||||
//! Returns TRUE if object is highlighted
|
||||
Standard_Boolean IsHilighted() const { return myIsHilit; }
|
||||
bool IsHilighted() const { return myIsHilit; }
|
||||
|
||||
//! Sets highlighted state.
|
||||
void SetHilightStatus(const Standard_Boolean theStatus) { myIsHilit = theStatus; }
|
||||
void SetHilightStatus(const bool theStatus) { myIsHilit = theStatus; }
|
||||
|
||||
//! Changes applied highlight style for a particular object
|
||||
void SetHilightStyle(const Handle(Prs3d_Drawer)& theStyle) { myHiStyle = theStyle; }
|
||||
void SetHilightStyle(const occ::handle<Prs3d_Drawer>& theStyle) { myHiStyle = theStyle; }
|
||||
|
||||
//! Returns applied highlight style for a particular object
|
||||
const Handle(Prs3d_Drawer)& HilightStyle() const { return myHiStyle; }
|
||||
const occ::handle<Prs3d_Drawer>& HilightStyle() const { return myHiStyle; }
|
||||
|
||||
//! Returns active selection modes of the object.
|
||||
const TColStd_ListOfInteger& SelectionModes() const { return mySelModes; }
|
||||
const NCollection_List<int>& SelectionModes() const { return mySelModes; }
|
||||
|
||||
//! Return TRUE if selection mode was registered.
|
||||
Standard_Boolean IsSModeIn(Standard_Integer theMode) const
|
||||
{
|
||||
return mySelModes.Contains(theMode);
|
||||
}
|
||||
bool IsSModeIn(int theMode) const { return mySelModes.Contains(theMode); }
|
||||
|
||||
//! Add selection mode.
|
||||
Standard_Boolean AddSelectionMode(const Standard_Integer theMode)
|
||||
bool AddSelectionMode(const int theMode)
|
||||
{
|
||||
if (!mySelModes.Contains(theMode))
|
||||
{
|
||||
mySelModes.Append(theMode);
|
||||
return Standard_True;
|
||||
return true;
|
||||
}
|
||||
return Standard_False;
|
||||
return false;
|
||||
}
|
||||
|
||||
//! Remove selection mode.
|
||||
Standard_Boolean RemoveSelectionMode(const Standard_Integer theMode)
|
||||
{
|
||||
return mySelModes.Remove(theMode);
|
||||
}
|
||||
bool RemoveSelectionMode(const int theMode) { return mySelModes.Remove(theMode); }
|
||||
|
||||
//! Remove all selection modes.
|
||||
void ClearSelectionModes() { mySelModes.Clear(); }
|
||||
|
||||
Standard_Boolean IsSubIntensityOn() const { return mySubInt; }
|
||||
bool IsSubIntensityOn() const { return mySubInt; }
|
||||
|
||||
void SetSubIntensity(Standard_Boolean theIsOn) { mySubInt = theIsOn; }
|
||||
void SetSubIntensity(bool theIsOn) { mySubInt = theIsOn; }
|
||||
|
||||
private:
|
||||
TColStd_ListOfInteger mySelModes;
|
||||
Handle(Prs3d_Drawer) myHiStyle;
|
||||
Standard_Integer myDispMode;
|
||||
Standard_Boolean myIsHilit;
|
||||
Standard_Boolean mySubInt;
|
||||
NCollection_List<int> mySelModes;
|
||||
occ::handle<Prs3d_Drawer> myHiStyle;
|
||||
int myDispMode;
|
||||
bool myIsHilit;
|
||||
bool mySubInt;
|
||||
};
|
||||
|
||||
#endif // _AIS_GlobalStatus_HeaderFile
|
||||
|
||||
@ -17,14 +17,14 @@
|
||||
#ifndef _AIS_GraphicTool_HeaderFile
|
||||
#define _AIS_GraphicTool_HeaderFile
|
||||
|
||||
#include "Standard.hxx"
|
||||
#include "Standard_DefineAlloc.hxx"
|
||||
#include "Standard_Handle.hxx"
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include "Prs3d_Drawer.hxx"
|
||||
#include "AIS_TypeOfAttribute.hxx"
|
||||
#include "Standard_Real.hxx"
|
||||
#include "Aspect_TypeOfLine.hxx"
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <AIS_TypeOfAttribute.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Aspect_TypeOfLine.hxx>
|
||||
class Quantity_Color;
|
||||
class Graphic3d_MaterialAspect;
|
||||
|
||||
@ -34,35 +34,34 @@ public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
Standard_EXPORT static Quantity_NameOfColor GetLineColor(
|
||||
const Handle(Prs3d_Drawer)& aDrawer,
|
||||
const AIS_TypeOfAttribute TheTypeOfAttributes);
|
||||
const occ::handle<Prs3d_Drawer>& aDrawer,
|
||||
const AIS_TypeOfAttribute TheTypeOfAttributes);
|
||||
|
||||
Standard_EXPORT static void GetLineColor(const Handle(Prs3d_Drawer)& aDrawer,
|
||||
const AIS_TypeOfAttribute TheTypeOfAttributes,
|
||||
Quantity_Color& TheLineColor);
|
||||
Standard_EXPORT static void GetLineColor(const occ::handle<Prs3d_Drawer>& aDrawer,
|
||||
const AIS_TypeOfAttribute TheTypeOfAttributes,
|
||||
Quantity_Color& TheLineColor);
|
||||
|
||||
Standard_EXPORT static Standard_Real GetLineWidth(const Handle(Prs3d_Drawer)& aDrawer,
|
||||
const AIS_TypeOfAttribute TheTypeOfAttributes);
|
||||
Standard_EXPORT static double GetLineWidth(const occ::handle<Prs3d_Drawer>& aDrawer,
|
||||
const AIS_TypeOfAttribute TheTypeOfAttributes);
|
||||
|
||||
Standard_EXPORT static Aspect_TypeOfLine GetLineType(
|
||||
const Handle(Prs3d_Drawer)& aDrawer,
|
||||
const AIS_TypeOfAttribute TheTypeOfAttributes);
|
||||
const occ::handle<Prs3d_Drawer>& aDrawer,
|
||||
const AIS_TypeOfAttribute TheTypeOfAttributes);
|
||||
|
||||
Standard_EXPORT static void GetLineAtt(const Handle(Prs3d_Drawer)& aDrawer,
|
||||
const AIS_TypeOfAttribute TheTypeOfAttributes,
|
||||
Quantity_NameOfColor& aCol,
|
||||
Standard_Real& aWidth,
|
||||
Aspect_TypeOfLine& aTyp);
|
||||
Standard_EXPORT static void GetLineAtt(const occ::handle<Prs3d_Drawer>& aDrawer,
|
||||
const AIS_TypeOfAttribute TheTypeOfAttributes,
|
||||
Quantity_NameOfColor& aCol,
|
||||
double& aWidth,
|
||||
Aspect_TypeOfLine& aTyp);
|
||||
|
||||
Standard_EXPORT static Quantity_NameOfColor GetInteriorColor(const Handle(Prs3d_Drawer)& aDrawer);
|
||||
Standard_EXPORT static Quantity_NameOfColor GetInteriorColor(
|
||||
const occ::handle<Prs3d_Drawer>& aDrawer);
|
||||
|
||||
Standard_EXPORT static void GetInteriorColor(const Handle(Prs3d_Drawer)& aDrawer,
|
||||
Quantity_Color& aColor);
|
||||
Standard_EXPORT static void GetInteriorColor(const occ::handle<Prs3d_Drawer>& aDrawer,
|
||||
Quantity_Color& aColor);
|
||||
|
||||
Standard_EXPORT static Graphic3d_MaterialAspect GetMaterial(const Handle(Prs3d_Drawer)& aDrawer);
|
||||
|
||||
protected:
|
||||
private:
|
||||
Standard_EXPORT static Graphic3d_MaterialAspect GetMaterial(
|
||||
const occ::handle<Prs3d_Drawer>& aDrawer);
|
||||
};
|
||||
|
||||
#endif // _AIS_GraphicTool_HeaderFile
|
||||
|
||||
@ -1,22 +0,0 @@
|
||||
// Copyright (c) 2020 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _AIS_IdenticRelation_HeaderFile
|
||||
#define _AIS_IdenticRelation_HeaderFile
|
||||
|
||||
#include "PrsDim_IdenticRelation.hxx"
|
||||
|
||||
Standard_DEPRECATED("Deprecated alias to moved class")
|
||||
typedef PrsDim_IdenticRelation AIS_IdenticRelation;
|
||||
|
||||
#endif // _AIS_IdenticRelation_HeaderFile
|
||||
File diff suppressed because it is too large
Load Diff
@ -17,9 +17,9 @@
|
||||
#ifndef _AIS_InteractiveObject_HeaderFile
|
||||
#define _AIS_InteractiveObject_HeaderFile
|
||||
|
||||
#include "AIS_KindOfInteractive.hxx"
|
||||
#include "AIS_DragAction.hxx"
|
||||
#include "SelectMgr_SelectableObject.hxx"
|
||||
#include <AIS_KindOfInteractive.hxx>
|
||||
#include <AIS_DragAction.hxx>
|
||||
#include <SelectMgr_SelectableObject.hxx>
|
||||
|
||||
class AIS_InteractiveContext;
|
||||
class Prs3d_BasicAspect;
|
||||
@ -60,30 +60,30 @@ public:
|
||||
//! - Line signature 5
|
||||
//! - Circle signature 6
|
||||
//! - Plane signature 7.
|
||||
virtual Standard_Integer Signature() const { return -1; }
|
||||
virtual int Signature() const { return -1; }
|
||||
|
||||
//! Updates the active presentation; if <AllModes> = Standard_True
|
||||
//! Updates the active presentation; if <AllModes> = true
|
||||
//! all the presentations inside are recomputed.
|
||||
//! IMPORTANT: It is preferable to call Redisplay method of
|
||||
//! corresponding AIS_InteractiveContext instance for cases when it
|
||||
//! is accessible. This method just redirects call to myCTXPtr,
|
||||
//! so this class field must be up to date for proper result.
|
||||
Standard_EXPORT void Redisplay(const Standard_Boolean AllModes = Standard_False);
|
||||
Standard_EXPORT void Redisplay(const bool AllModes = false);
|
||||
|
||||
//! Indicates whether the Interactive Object has a pointer to an interactive context.
|
||||
Standard_Boolean HasInteractiveContext() const { return myCTXPtr != NULL; }
|
||||
bool HasInteractiveContext() const { return myCTXPtr != nullptr; }
|
||||
|
||||
//! Returns the context pointer to the interactive context.
|
||||
AIS_InteractiveContext* InteractiveContext() const { return myCTXPtr; }
|
||||
|
||||
//! Sets the interactive context aCtx and provides a link
|
||||
//! to the default drawing tool or "Drawer" if there is none.
|
||||
Standard_EXPORT virtual void SetContext(const Handle(AIS_InteractiveContext)& aCtx);
|
||||
Standard_EXPORT virtual void SetContext(const occ::handle<AIS_InteractiveContext>& aCtx);
|
||||
|
||||
//! Returns true if the object has an owner attributed to it.
|
||||
//! The owner can be a shape for a set of sub-shapes or a sub-shape for sub-shapes which it is
|
||||
//! composed of, and takes the form of a transient.
|
||||
Standard_Boolean HasOwner() const { return !myOwner.IsNull(); }
|
||||
bool HasOwner() const { return !myOwner.IsNull(); }
|
||||
|
||||
//! Returns the owner of the Interactive Object.
|
||||
//! The owner can be a shape for a set of sub-shapes or
|
||||
@ -94,13 +94,13 @@ public:
|
||||
//! edges, wires, and faces.
|
||||
//! - Users, presentable objects connecting to sensitive
|
||||
//! primitives, or a shape which has been decomposed.
|
||||
const Handle(Standard_Transient)& GetOwner() const { return myOwner; }
|
||||
const occ::handle<Standard_Transient>& GetOwner() const { return myOwner; }
|
||||
|
||||
//! Allows you to attribute the owner theApplicativeEntity to
|
||||
//! an Interactive Object. This can be a shape for a set of
|
||||
//! sub-shapes or a sub-shape for sub-shapes which it
|
||||
//! is composed of. The owner takes the form of a transient.
|
||||
void SetOwner(const Handle(Standard_Transient)& theApplicativeEntity)
|
||||
void SetOwner(const occ::handle<Standard_Transient>& theApplicativeEntity)
|
||||
{
|
||||
myOwner = theApplicativeEntity;
|
||||
}
|
||||
@ -117,31 +117,29 @@ public:
|
||||
//! @param[in] theDragTo drag end point
|
||||
//! @param[in] theAction drag action
|
||||
//! @return FALSE if object rejects dragging action (e.g. AIS_DragAction_Start)
|
||||
Standard_EXPORT virtual Standard_Boolean ProcessDragging(
|
||||
const Handle(AIS_InteractiveContext)& theCtx,
|
||||
const Handle(V3d_View)& theView,
|
||||
const Handle(SelectMgr_EntityOwner)& theOwner,
|
||||
const Graphic3d_Vec2i& theDragFrom,
|
||||
const Graphic3d_Vec2i& theDragTo,
|
||||
const AIS_DragAction theAction);
|
||||
Standard_EXPORT virtual bool ProcessDragging(const occ::handle<AIS_InteractiveContext>& theCtx,
|
||||
const occ::handle<V3d_View>& theView,
|
||||
const occ::handle<SelectMgr_EntityOwner>& theOwner,
|
||||
const NCollection_Vec2<int>& theDragFrom,
|
||||
const NCollection_Vec2<int>& theDragTo,
|
||||
const AIS_DragAction theAction);
|
||||
|
||||
public:
|
||||
//! Returns the context pointer to the interactive context.
|
||||
Standard_EXPORT Handle(AIS_InteractiveContext) GetContext() const;
|
||||
Standard_EXPORT occ::handle<AIS_InteractiveContext> GetContext() const;
|
||||
|
||||
//! Returns TRUE when this object has a presentation in the current DisplayMode()
|
||||
Standard_EXPORT Standard_Boolean HasPresentation() const;
|
||||
Standard_EXPORT bool HasPresentation() const;
|
||||
|
||||
//! Returns the current presentation of this object according to the current DisplayMode()
|
||||
Standard_EXPORT Handle(Prs3d_Presentation) Presentation() const;
|
||||
Standard_EXPORT occ::handle<Prs3d_Presentation> Presentation() const;
|
||||
|
||||
//! Sets the graphic basic aspect to the current presentation.
|
||||
Standard_DEPRECATED("Deprecated method, results might be undefined")
|
||||
Standard_EXPORT void SetAspect(const Handle(Prs3d_BasicAspect)& anAspect);
|
||||
Standard_EXPORT void SetAspect(const occ::handle<Prs3d_BasicAspect>& anAspect);
|
||||
|
||||
//! Dumps the content of me into the stream
|
||||
Standard_EXPORT virtual void DumpJson(Standard_OStream& theOStream,
|
||||
Standard_Integer theDepth = -1) const Standard_OVERRIDE;
|
||||
Standard_EXPORT void DumpJson(Standard_OStream& theOStream, int theDepth = -1) const override;
|
||||
|
||||
protected:
|
||||
//! The TypeOfPresention3d means that the interactive object
|
||||
@ -156,9 +154,7 @@ protected:
|
||||
// clang-format off
|
||||
AIS_InteractiveContext* myCTXPtr; //!< pointer to Interactive Context, where object is currently displayed; @sa SetContext()
|
||||
// clang-format on
|
||||
Handle(Standard_Transient) myOwner; //!< application-specific owner object
|
||||
occ::handle<Standard_Transient> myOwner; //!< application-specific owner object
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE(AIS_InteractiveObject, SelectMgr_SelectableObject)
|
||||
|
||||
#endif // _AIS_InteractiveObject_HeaderFile
|
||||
|
||||
@ -1,22 +0,0 @@
|
||||
// Copyright (c) 2020 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _AIS_LengthDimension_HeaderFile
|
||||
#define _AIS_LengthDimension_HeaderFile
|
||||
|
||||
#include "PrsDim_LengthDimension.hxx"
|
||||
|
||||
Standard_DEPRECATED("Deprecated alias to moved class")
|
||||
typedef PrsDim_LengthDimension AIS_LengthDimension;
|
||||
|
||||
#endif // _AIS_LengthDimension_HeaderFile
|
||||
@ -16,10 +16,10 @@
|
||||
#ifndef _AIS_LightSource_HeaderFile
|
||||
#define _AIS_LightSource_HeaderFile
|
||||
|
||||
#include "AIS_InteractiveObject.hxx"
|
||||
#include "Graphic3d_AspectLine3d.hxx"
|
||||
#include "Graphic3d_AspectMarker3d.hxx"
|
||||
#include "SelectMgr_EntityOwner.hxx"
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <Graphic3d_AspectLine3d.hxx>
|
||||
#include <Graphic3d_AspectMarker3d.hxx>
|
||||
#include <SelectMgr_EntityOwner.hxx>
|
||||
|
||||
class Select3D_SensitiveSphere;
|
||||
|
||||
@ -37,13 +37,13 @@ class AIS_LightSource : public AIS_InteractiveObject
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_LightSource, AIS_InteractiveObject)
|
||||
public:
|
||||
//! Initializes the light source by copying Graphic3d_CLight settings.
|
||||
Standard_EXPORT AIS_LightSource(const Handle(Graphic3d_CLight)& theLightSource);
|
||||
Standard_EXPORT AIS_LightSource(const occ::handle<Graphic3d_CLight>& theLightSource);
|
||||
|
||||
//! Returns the light.
|
||||
const Handle(Graphic3d_CLight)& Light() const { return myLightSource; }
|
||||
const occ::handle<Graphic3d_CLight>& Light() const { return myLightSource; }
|
||||
|
||||
//! Set the light.
|
||||
void SetLight(const Handle(Graphic3d_CLight)& theLight)
|
||||
void SetLight(const occ::handle<Graphic3d_CLight>& theLight)
|
||||
{
|
||||
myLightSource = theLight;
|
||||
SetToUpdate();
|
||||
@ -51,10 +51,10 @@ public:
|
||||
|
||||
public: //! @name Light properties
|
||||
//! Returns TRUE if the light source name should be displayed; TRUE by default.
|
||||
Standard_Boolean ToDisplayName() const { return myToDisplayName; }
|
||||
bool ToDisplayName() const { return myToDisplayName; }
|
||||
|
||||
//! Show/hide light source name.
|
||||
void SetDisplayName(Standard_Boolean theToDisplay)
|
||||
void SetDisplayName(bool theToDisplay)
|
||||
{
|
||||
if (myToDisplayName != theToDisplay)
|
||||
{
|
||||
@ -65,10 +65,10 @@ public: //! @name Light properties
|
||||
|
||||
//! Returns TRUE to display light source range as sphere (positional light) or cone (spot light);
|
||||
//! TRUE by default. Has no effect for non-zoomable presentation.
|
||||
Standard_Boolean ToDisplayRange() const { return myToDisplayRange; }
|
||||
bool ToDisplayRange() const { return myToDisplayRange; }
|
||||
|
||||
//! Show/hide light source range shaded presentation.
|
||||
void SetDisplayRange(Standard_Boolean theToDisplay)
|
||||
void SetDisplayRange(bool theToDisplay)
|
||||
{
|
||||
if (myToDisplayRange != theToDisplay)
|
||||
{
|
||||
@ -78,10 +78,10 @@ public: //! @name Light properties
|
||||
}
|
||||
|
||||
//! Returns the size of presentation; 50 by default.
|
||||
Standard_Real Size() const { return mySize; }
|
||||
double Size() const { return mySize; }
|
||||
|
||||
//! Sets the size of presentation.
|
||||
void SetSize(Standard_Real theSize)
|
||||
void SetSize(double theSize)
|
||||
{
|
||||
if (mySize != theSize)
|
||||
{
|
||||
@ -91,10 +91,10 @@ public: //! @name Light properties
|
||||
}
|
||||
|
||||
//! Returns Sensitive sphere arc size in pixels; 20 by default.
|
||||
Standard_Integer ArcSize() const { return mySensSphereArcSize; }
|
||||
int ArcSize() const { return mySensSphereArcSize; }
|
||||
|
||||
//! Sets the size of sensitive sphere arc.
|
||||
void SetArcSize(Standard_Integer theSize)
|
||||
void SetArcSize(int theSize)
|
||||
{
|
||||
if (mySensSphereArcSize != theSize)
|
||||
{
|
||||
@ -134,10 +134,10 @@ public: //! @name Light properties
|
||||
void SetSwitchOnClick(bool theToHandle) { myToSwitchOnClick = theToHandle; }
|
||||
|
||||
//! Returns a number of directional light arrows to display; 5 by default.
|
||||
Standard_Integer NbArrows() const { return myNbArrows; }
|
||||
int NbArrows() const { return myNbArrows; }
|
||||
|
||||
//! Returns a number of directional light arrows to display (supported values: 1, 3, 5, 9).
|
||||
void SetNbArrows(Standard_Integer theNbArrows)
|
||||
void SetNbArrows(int theNbArrows)
|
||||
{
|
||||
if (myNbArrows != theNbArrows)
|
||||
{
|
||||
@ -148,7 +148,7 @@ public: //! @name Light properties
|
||||
|
||||
//! Returns light source icon.
|
||||
//! @param[in] theIsEnabled marker index for enabled/disabled light source states
|
||||
const Handle(Graphic3d_MarkerImage)& MarkerImage(bool theIsEnabled) const
|
||||
const occ::handle<Graphic3d_MarkerImage>& MarkerImage(bool theIsEnabled) const
|
||||
{
|
||||
return myMarkerImages[theIsEnabled ? 1 : 0];
|
||||
}
|
||||
@ -161,7 +161,7 @@ public: //! @name Light properties
|
||||
}
|
||||
|
||||
//! Sets custom icon to light source.
|
||||
void SetMarkerImage(const Handle(Graphic3d_MarkerImage)& theImage, bool theIsEnabled)
|
||||
void SetMarkerImage(const occ::handle<Graphic3d_MarkerImage>& theImage, bool theIsEnabled)
|
||||
{
|
||||
myMarkerImages[theIsEnabled ? 1 : 0] = theImage;
|
||||
myMarkerTypes[theIsEnabled ? 1 : 0] = !theImage.IsNull()
|
||||
@ -176,39 +176,33 @@ public: //! @name Light properties
|
||||
}
|
||||
|
||||
//! Returns tessellation level for quadric surfaces; 30 by default.
|
||||
Standard_Integer NbSplitsQuadric() const { return myNbSplitsQuadric; }
|
||||
int NbSplitsQuadric() const { return myNbSplitsQuadric; }
|
||||
|
||||
//! Sets tessellation level for quadric surfaces.
|
||||
void SetNbSplitsQuadric(Standard_Integer theNbSplits) { myNbSplitsQuadric = theNbSplits; }
|
||||
void SetNbSplitsQuadric(int theNbSplits) { myNbSplitsQuadric = theNbSplits; }
|
||||
|
||||
//! Returns tessellation level for arrows; 20 by default.
|
||||
Standard_Integer NbSplitsArrow() const { return myNbSplitsArrow; }
|
||||
int NbSplitsArrow() const { return myNbSplitsArrow; }
|
||||
|
||||
//! Sets tessellation level for arrows.
|
||||
void SetNbSplitsArrow(Standard_Integer theNbSplits) { myNbSplitsArrow = theNbSplits; }
|
||||
void SetNbSplitsArrow(int theNbSplits) { myNbSplitsArrow = theNbSplits; }
|
||||
|
||||
//! Returns kind of the object.
|
||||
virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE
|
||||
{
|
||||
return AIS_KindOfInteractive_LightSource;
|
||||
}
|
||||
AIS_KindOfInteractive Type() const override { return AIS_KindOfInteractive_LightSource; }
|
||||
|
||||
protected:
|
||||
//! Return true if specified display mode is supported: 0 for main presentation and 1 for
|
||||
//! highlight.
|
||||
virtual Standard_Boolean AcceptDisplayMode(const Standard_Integer theMode) const Standard_OVERRIDE
|
||||
{
|
||||
return theMode == 0 || theMode == 1;
|
||||
}
|
||||
bool AcceptDisplayMode(const int theMode) const override { return theMode == 0 || theMode == 1; }
|
||||
|
||||
//! Computes selection sensitive zones(triangulation) for light source presentation.
|
||||
Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager)& thePrsMgr,
|
||||
const Handle(Prs3d_Presentation)& thePrs,
|
||||
const Standard_Integer theMode) Standard_OVERRIDE;
|
||||
Standard_EXPORT void Compute(const occ::handle<PrsMgr_PresentationManager>& thePrsMgr,
|
||||
const occ::handle<Prs3d_Presentation>& thePrs,
|
||||
const int theMode) override;
|
||||
|
||||
//! Fills presentation.
|
||||
Standard_EXPORT virtual void ComputeSelection(const Handle(SelectMgr_Selection)& theSel,
|
||||
const Standard_Integer theMode) Standard_OVERRIDE;
|
||||
Standard_EXPORT void ComputeSelection(const occ::handle<SelectMgr_Selection>& theSel,
|
||||
const int theMode) override;
|
||||
|
||||
//! Drag object in the viewer.
|
||||
//! @param[in] theCtx interactive context
|
||||
@ -218,17 +212,15 @@ protected:
|
||||
//! @param[in] theDragTo drag end point
|
||||
//! @param[in] theAction drag action
|
||||
//! @return FALSE if object rejects dragging action (e.g. AIS_DragAction_Start)
|
||||
Standard_EXPORT virtual Standard_Boolean ProcessDragging(
|
||||
const Handle(AIS_InteractiveContext)& theCtx,
|
||||
const Handle(V3d_View)& theView,
|
||||
const Handle(SelectMgr_EntityOwner)& theOwner,
|
||||
const Graphic3d_Vec2i& theDragFrom,
|
||||
const Graphic3d_Vec2i& theDragTo,
|
||||
const AIS_DragAction theAction) Standard_OVERRIDE;
|
||||
Standard_EXPORT bool ProcessDragging(const occ::handle<AIS_InteractiveContext>& theCtx,
|
||||
const occ::handle<V3d_View>& theView,
|
||||
const occ::handle<SelectMgr_EntityOwner>& theOwner,
|
||||
const NCollection_Vec2<int>& theDragFrom,
|
||||
const NCollection_Vec2<int>& theDragTo,
|
||||
const AIS_DragAction theAction) override;
|
||||
|
||||
//! Sets new local transformation, which is propagated to Graphic3d_CLight instance.
|
||||
Standard_EXPORT virtual void setLocalTransformation(const Handle(TopLoc_Datum3D)& theTrsf)
|
||||
Standard_OVERRIDE;
|
||||
Standard_EXPORT void setLocalTransformation(const occ::handle<TopLoc_Datum3D>& theTrsf) override;
|
||||
|
||||
//! Updates local transformation basing on a type of light source.
|
||||
Standard_EXPORT virtual void updateLightLocalTransformation();
|
||||
@ -240,46 +232,46 @@ protected:
|
||||
Standard_EXPORT virtual void updateLightAspects();
|
||||
|
||||
//! Compute ambient light source presentation as a sphere at view corner.
|
||||
Standard_EXPORT virtual void computeAmbient(const Handle(Prs3d_Presentation)& thePrs,
|
||||
const Standard_Integer theMode);
|
||||
Standard_EXPORT virtual void computeAmbient(const occ::handle<Prs3d_Presentation>& thePrs,
|
||||
const int theMode);
|
||||
|
||||
//! Compute directional light source presentation as a set of arrows at view corner.
|
||||
Standard_EXPORT virtual void computeDirectional(const Handle(Prs3d_Presentation)& thePrs,
|
||||
const Standard_Integer theMode);
|
||||
Standard_EXPORT virtual void computeDirectional(const occ::handle<Prs3d_Presentation>& thePrs,
|
||||
const int theMode);
|
||||
|
||||
//! Compute positional light source presentation as a sphere of either fixed size (no range) or of
|
||||
//! size representing a maximum range.
|
||||
Standard_EXPORT virtual void computePositional(const Handle(Prs3d_Presentation)& thePrs,
|
||||
const Standard_Integer theMode);
|
||||
Standard_EXPORT virtual void computePositional(const occ::handle<Prs3d_Presentation>& thePrs,
|
||||
const int theMode);
|
||||
|
||||
//! Compute spot light source presentation as a cone.
|
||||
Standard_EXPORT virtual void computeSpot(const Handle(Prs3d_Presentation)& thePrs,
|
||||
const Standard_Integer theMode);
|
||||
Standard_EXPORT virtual void computeSpot(const occ::handle<Prs3d_Presentation>& thePrs,
|
||||
const int theMode);
|
||||
|
||||
protected:
|
||||
Handle(Graphic3d_CLight) myLightSource; //!< displayed light source
|
||||
occ::handle<Graphic3d_CLight> myLightSource; //!< displayed light source
|
||||
|
||||
// clang-format off
|
||||
Handle(Graphic3d_AspectMarker3d) myDisabledMarkerAspect; //!< disabled light source marker style
|
||||
Handle(Graphic3d_AspectLine3d) myArrowLineAspectShadow; //!< arrow shadow style
|
||||
Handle(Graphic3d_MarkerImage) myMarkerImages[2]; //!< icon of disabled (0) and enabled (1) light
|
||||
Handle(Select3D_SensitiveSphere) mySensSphere; //!< sensitive sphere of directional light source
|
||||
occ::handle<Graphic3d_AspectMarker3d> myDisabledMarkerAspect; //!< disabled light source marker style
|
||||
occ::handle<Graphic3d_AspectLine3d> myArrowLineAspectShadow; //!< arrow shadow style
|
||||
occ::handle<Graphic3d_MarkerImage> myMarkerImages[2]; //!< icon of disabled (0) and enabled (1) light
|
||||
occ::handle<Select3D_SensitiveSphere> mySensSphere; //!< sensitive sphere of directional light source
|
||||
Aspect_TypeOfMarker myMarkerTypes[2]; //!< icon of disabled (0) and enabled (1) light
|
||||
Aspect_TypeOfMarker myCodirMarkerType; //!< icon of arrow co-directional to camera direction (look from)
|
||||
Aspect_TypeOfMarker myOpposMarkerType; //!< icon of arrow opposite to camera direction (look at)
|
||||
|
||||
gp_Trsf myLocTrsfStart; //!< object transformation before transformation
|
||||
Standard_Real mySize; //!< presentation size
|
||||
Standard_Integer myNbArrows; //!< number of directional light arrows
|
||||
Standard_Integer myNbSplitsQuadric; //!< tessellation level for quadric surfaces
|
||||
Standard_Integer myNbSplitsArrow; //!< tessellation level for arrows
|
||||
Standard_Integer mySensSphereArcSize; //! sensitive sphere arc size in pixels
|
||||
Standard_Boolean myIsZoomable; //!< flag to allow/disallow transform-persistence when possible
|
||||
Standard_Boolean myIsDraggable; //!< flag to allow/disallow rotate directional light source by dragging
|
||||
double mySize; //!< presentation size
|
||||
int myNbArrows; //!< number of directional light arrows
|
||||
int myNbSplitsQuadric; //!< tessellation level for quadric surfaces
|
||||
int myNbSplitsArrow; //!< tessellation level for arrows
|
||||
int mySensSphereArcSize; //! sensitive sphere arc size in pixels
|
||||
bool myIsZoomable; //!< flag to allow/disallow transform-persistence when possible
|
||||
bool myIsDraggable; //!< flag to allow/disallow rotate directional light source by dragging
|
||||
// clang-format on
|
||||
Standard_Boolean myToDisplayName; //!< flag to show/hide name
|
||||
Standard_Boolean myToDisplayRange; //!< flag to show/hide range of positional/spot light
|
||||
Standard_Boolean myToSwitchOnClick; //!< flag to handle mouse click to turn light on/off
|
||||
bool myToDisplayName; //!< flag to show/hide name
|
||||
bool myToDisplayRange; //!< flag to show/hide range of positional/spot light
|
||||
bool myToSwitchOnClick; //!< flag to handle mouse click to turn light on/off
|
||||
};
|
||||
|
||||
//! Owner of AIS_LightSource presentation.
|
||||
@ -288,26 +280,25 @@ class AIS_LightSourceOwner : public SelectMgr_EntityOwner
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_LightSourceOwner, SelectMgr_EntityOwner)
|
||||
public:
|
||||
//! Main constructor.
|
||||
Standard_EXPORT AIS_LightSourceOwner(const Handle(AIS_LightSource)& theObject,
|
||||
Standard_Integer thePriority = 5);
|
||||
Standard_EXPORT AIS_LightSourceOwner(const occ::handle<AIS_LightSource>& theObject,
|
||||
int thePriority = 5);
|
||||
|
||||
//! Handle mouse button click event.
|
||||
Standard_EXPORT virtual Standard_Boolean HandleMouseClick(const Graphic3d_Vec2i& thePoint,
|
||||
Aspect_VKeyMouse theButton,
|
||||
Aspect_VKeyFlags theModifiers,
|
||||
bool theIsDoubleClick)
|
||||
Standard_OVERRIDE;
|
||||
Standard_EXPORT bool HandleMouseClick(const NCollection_Vec2<int>& thePoint,
|
||||
Aspect_VKeyMouse theButton,
|
||||
Aspect_VKeyFlags theModifiers,
|
||||
bool theIsDoubleClick) override;
|
||||
|
||||
//! Highlights selectable object's presentation with display mode in presentation manager with
|
||||
//! given highlight style. Also a check for auto-highlight is performed - if selectable object
|
||||
//! manages highlighting on its own, execution will be passed to
|
||||
//! SelectMgr_SelectableObject::HilightOwnerWithColor method.
|
||||
Standard_EXPORT virtual void HilightWithColor(const Handle(PrsMgr_PresentationManager)& thePrsMgr,
|
||||
const Handle(Prs3d_Drawer)& theStyle,
|
||||
const Standard_Integer theMode) Standard_OVERRIDE;
|
||||
Standard_EXPORT void HilightWithColor(const occ::handle<PrsMgr_PresentationManager>& thePrsMgr,
|
||||
const occ::handle<Prs3d_Drawer>& theStyle,
|
||||
const int theMode) override;
|
||||
|
||||
//! Always update dynamic highlighting.
|
||||
Standard_EXPORT virtual Standard_Boolean IsForcedHilight() const Standard_OVERRIDE;
|
||||
Standard_EXPORT bool IsForcedHilight() const override;
|
||||
};
|
||||
|
||||
#endif // _AIS_LightSource_HeaderFile
|
||||
|
||||
@ -17,8 +17,8 @@
|
||||
#ifndef _AIS_Line_HeaderFile
|
||||
#define _AIS_Line_HeaderFile
|
||||
|
||||
#include "AIS_InteractiveObject.hxx"
|
||||
#include "AIS_KindOfInteractive.hxx"
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <AIS_KindOfInteractive.hxx>
|
||||
|
||||
class Geom_Line;
|
||||
class Geom_Point;
|
||||
@ -30,86 +30,83 @@ class AIS_Line : public AIS_InteractiveObject
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_Line, AIS_InteractiveObject)
|
||||
public:
|
||||
//! Initializes the line aLine.
|
||||
Standard_EXPORT AIS_Line(const Handle(Geom_Line)& aLine);
|
||||
Standard_EXPORT AIS_Line(const occ::handle<Geom_Line>& aLine);
|
||||
|
||||
//! Initializes a starting point aStartPoint
|
||||
//! and a finishing point aEndPoint for the line.
|
||||
Standard_EXPORT AIS_Line(const Handle(Geom_Point)& aStartPoint,
|
||||
const Handle(Geom_Point)& aEndPoint);
|
||||
Standard_EXPORT AIS_Line(const occ::handle<Geom_Point>& aStartPoint,
|
||||
const occ::handle<Geom_Point>& aEndPoint);
|
||||
|
||||
//! Returns the signature 5.
|
||||
virtual Standard_Integer Signature() const Standard_OVERRIDE { return 5; }
|
||||
int Signature() const override { return 5; }
|
||||
|
||||
//! Returns the type Datum.
|
||||
virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE
|
||||
{
|
||||
return AIS_KindOfInteractive_Datum;
|
||||
}
|
||||
AIS_KindOfInteractive Type() const override { return AIS_KindOfInteractive_Datum; }
|
||||
|
||||
//! Constructs an infinite line.
|
||||
const Handle(Geom_Line)& Line() const { return myComponent; }
|
||||
const occ::handle<Geom_Line>& Line() const { return myComponent; }
|
||||
|
||||
//! Returns the starting point thePStart and the end point thePEnd of the line set by SetPoints.
|
||||
void Points(Handle(Geom_Point)& thePStart, Handle(Geom_Point)& thePEnd) const
|
||||
void Points(occ::handle<Geom_Point>& thePStart, occ::handle<Geom_Point>& thePEnd) const
|
||||
{
|
||||
thePStart = myStartPoint;
|
||||
thePEnd = myEndPoint;
|
||||
}
|
||||
|
||||
//! instantiates an infinite line.
|
||||
void SetLine(const Handle(Geom_Line)& theLine)
|
||||
void SetLine(const occ::handle<Geom_Line>& theLine)
|
||||
{
|
||||
myComponent = theLine;
|
||||
myLineIsSegment = Standard_False;
|
||||
myLineIsSegment = false;
|
||||
}
|
||||
|
||||
//! Sets the starting point thePStart and ending point thePEnd of the
|
||||
//! infinite line to create a finite line segment.
|
||||
void SetPoints(const Handle(Geom_Point)& thePStart, const Handle(Geom_Point)& thePEnd)
|
||||
void SetPoints(const occ::handle<Geom_Point>& thePStart, const occ::handle<Geom_Point>& thePEnd)
|
||||
{
|
||||
myStartPoint = thePStart;
|
||||
myEndPoint = thePEnd;
|
||||
myLineIsSegment = Standard_True;
|
||||
myLineIsSegment = true;
|
||||
}
|
||||
|
||||
//! Provides a new color setting aColor for the line in the drawing tool, or "Drawer".
|
||||
Standard_EXPORT void SetColor(const Quantity_Color& aColor) Standard_OVERRIDE;
|
||||
Standard_EXPORT void SetColor(const Quantity_Color& aColor) override;
|
||||
|
||||
//! Provides the new width setting aValue for the line in
|
||||
//! the drawing tool, or "Drawer".
|
||||
Standard_EXPORT void SetWidth(const Standard_Real aValue) Standard_OVERRIDE;
|
||||
Standard_EXPORT void SetWidth(const double aValue) override;
|
||||
|
||||
//! Removes the color setting and returns the original color.
|
||||
Standard_EXPORT void UnsetColor() Standard_OVERRIDE;
|
||||
Standard_EXPORT void UnsetColor() override;
|
||||
|
||||
//! Removes the width setting and returns the original width.
|
||||
Standard_EXPORT void UnsetWidth() Standard_OVERRIDE;
|
||||
Standard_EXPORT void UnsetWidth() override;
|
||||
|
||||
private:
|
||||
Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager)& thePrsMgr,
|
||||
const Handle(Prs3d_Presentation)& thePrs,
|
||||
const Standard_Integer theMode) Standard_OVERRIDE;
|
||||
Standard_EXPORT void Compute(const occ::handle<PrsMgr_PresentationManager>& thePrsMgr,
|
||||
const occ::handle<Prs3d_Presentation>& thePrs,
|
||||
const int theMode) override;
|
||||
|
||||
Standard_EXPORT virtual void ComputeSelection(const Handle(SelectMgr_Selection)& theSel,
|
||||
const Standard_Integer theMode) Standard_OVERRIDE;
|
||||
Standard_EXPORT void ComputeSelection(const occ::handle<SelectMgr_Selection>& theSel,
|
||||
const int theMode) override;
|
||||
|
||||
Standard_EXPORT void ComputeInfiniteLine(const Handle(Prs3d_Presentation)& aPresentation);
|
||||
Standard_EXPORT void ComputeInfiniteLine(const occ::handle<Prs3d_Presentation>& aPresentation);
|
||||
|
||||
Standard_EXPORT void ComputeSegmentLine(const Handle(Prs3d_Presentation)& aPresentation);
|
||||
Standard_EXPORT void ComputeSegmentLine(const occ::handle<Prs3d_Presentation>& aPresentation);
|
||||
|
||||
Standard_EXPORT void ComputeInfiniteLineSelection(const Handle(SelectMgr_Selection)& aSelection);
|
||||
Standard_EXPORT void ComputeInfiniteLineSelection(
|
||||
const occ::handle<SelectMgr_Selection>& aSelection);
|
||||
|
||||
Standard_EXPORT void ComputeSegmentLineSelection(const Handle(SelectMgr_Selection)& aSelection);
|
||||
Standard_EXPORT void ComputeSegmentLineSelection(
|
||||
const occ::handle<SelectMgr_Selection>& aSelection);
|
||||
//! Replace aspects of already computed groups with the new value.
|
||||
void replaceWithNewLineAspect(const Handle(Prs3d_LineAspect)& theAspect);
|
||||
void replaceWithNewLineAspect(const occ::handle<Prs3d_LineAspect>& theAspect);
|
||||
|
||||
private:
|
||||
Handle(Geom_Line) myComponent;
|
||||
Handle(Geom_Point) myStartPoint;
|
||||
Handle(Geom_Point) myEndPoint;
|
||||
Standard_Boolean myLineIsSegment;
|
||||
occ::handle<Geom_Line> myComponent;
|
||||
occ::handle<Geom_Point> myStartPoint;
|
||||
occ::handle<Geom_Point> myEndPoint;
|
||||
bool myLineIsSegment;
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE(AIS_Line, AIS_InteractiveObject)
|
||||
|
||||
#endif // _AIS_Line_HeaderFile
|
||||
|
||||
@ -1,19 +0,0 @@
|
||||
// Copyright (c) 2015 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef AIS_ListIteratorOfListOfInteractive_HeaderFile
|
||||
#define AIS_ListIteratorOfListOfInteractive_HeaderFile
|
||||
|
||||
#include "AIS_ListOfInteractive.hxx"
|
||||
|
||||
#endif
|
||||
@ -1,7 +1,4 @@
|
||||
// Created on: 1996-12-11
|
||||
// Created by: Robert COUBLANC
|
||||
// Copyright (c) 1996-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
// Copyright (c) 2025 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
@ -14,14 +11,28 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef AIS_ListOfInteractive_HeaderFile
|
||||
#define AIS_ListOfInteractive_HeaderFile
|
||||
//! @file AIS_ListOfInteractive.hxx
|
||||
//! @brief Deprecated typedef for backward compatibility.
|
||||
//! @deprecated This header is deprecated since OCCT 8.0.0.
|
||||
//! Use NCollection types directly instead.
|
||||
|
||||
#include "AIS_InteractiveObject.hxx"
|
||||
#include "NCollection_List.hxx"
|
||||
#ifndef _AIS_ListOfInteractive_hxx
|
||||
#define _AIS_ListOfInteractive_hxx
|
||||
|
||||
typedef NCollection_List<Handle(AIS_InteractiveObject)> AIS_ListOfInteractive;
|
||||
typedef NCollection_List<Handle(AIS_InteractiveObject)>::Iterator
|
||||
#include <Standard_Macro.hxx>
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <NCollection_List.hxx>
|
||||
|
||||
Standard_HEADER_DEPRECATED(
|
||||
"AIS_ListOfInteractive.hxx is deprecated since OCCT 8.0.0. Use NCollection types directly.")
|
||||
|
||||
Standard_DEPRECATED("AIS_ListOfInteractive is deprecated, use "
|
||||
"NCollection_List<opencascade::handle<AIS_InteractiveObject>> directly")
|
||||
typedef NCollection_List<opencascade::handle<AIS_InteractiveObject>> AIS_ListOfInteractive;
|
||||
Standard_DEPRECATED(
|
||||
"AIS_ListIteratorOfListOfInteractive is deprecated, use "
|
||||
"NCollection_List<opencascade::handle<AIS_InteractiveObject>>::Iterator directly")
|
||||
typedef NCollection_List<opencascade::handle<AIS_InteractiveObject>>::Iterator
|
||||
AIS_ListIteratorOfListOfInteractive;
|
||||
|
||||
#endif
|
||||
#endif // _AIS_ListOfInteractive_hxx
|
||||
|
||||
@ -16,21 +16,17 @@
|
||||
#ifndef _AIS_Manipulator_HeaderFile
|
||||
#define _AIS_Manipulator_HeaderFile
|
||||
|
||||
#include "AIS_InteractiveObject.hxx"
|
||||
#include "AIS_ManipulatorMode.hxx"
|
||||
#include "gp_Ax1.hxx"
|
||||
#include "gp_Dir.hxx"
|
||||
#include "gp_Pnt.hxx"
|
||||
#include "Graphic3d_ArrayOfTriangles.hxx"
|
||||
#include "Graphic3d_Group.hxx"
|
||||
#include "NCollection_HSequence.hxx"
|
||||
#include "Poly_Triangulation.hxx"
|
||||
#include "V3d_View.hxx"
|
||||
#include "Standard_DefineHandle.hxx"
|
||||
|
||||
NCOLLECTION_HSEQUENCE(AIS_ManipulatorObjectSequence, Handle(AIS_InteractiveObject))
|
||||
|
||||
DEFINE_STANDARD_HANDLE(AIS_Manipulator, AIS_InteractiveObject)
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <AIS_ManipulatorMode.hxx>
|
||||
#include <gp_Ax1.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Graphic3d_ArrayOfTriangles.hxx>
|
||||
#include <Graphic3d_Group.hxx>
|
||||
#include <NCollection_HSequence.hxx>
|
||||
#include <Poly_Triangulation.hxx>
|
||||
#include <V3d_View.hxx>
|
||||
#include <Standard_DefineHandle.hxx>
|
||||
|
||||
//! Interactive object class to manipulate local transformation of another interactive
|
||||
//! object or a group of objects via mouse.
|
||||
@ -47,9 +43,9 @@ DEFINE_STANDARD_HANDLE(AIS_Manipulator, AIS_InteractiveObject)
|
||||
//! for an interactive object:
|
||||
//! Step 1. Create manipulator object and adjust it appearance:
|
||||
//! @code
|
||||
//! Handle(AIS_Manipulator) aManipulator = new AIS_Manipulator();
|
||||
//! aManipulator->SetPart (0, AIS_Manipulator::Scaling, Standard_False);
|
||||
//! aManipulator->SetPart (1, AIS_Manipulator::Rotation, Standard_False);
|
||||
//! occ::handle<AIS_Manipulator> aManipulator = new AIS_Manipulator();
|
||||
//! aManipulator->SetPart (0, AIS_Manipulator::Scaling, false);
|
||||
//! aManipulator->SetPart (1, AIS_Manipulator::Rotation, false);
|
||||
//! // Attach manipulator to already displayed object and manage manipulation modes
|
||||
//! aManipulator->AttachToObject (anAISObject);
|
||||
//! aManipulator->EnableMode (AIS_Manipulator::Translation);
|
||||
@ -62,7 +58,7 @@ DEFINE_STANDARD_HANDLE(AIS_Manipulator, AIS_InteractiveObject)
|
||||
//! If this mode is activated, no selection will be performed for manipulator.
|
||||
//! It can be activated with highlighting. To enable this:
|
||||
//! @code
|
||||
//! aManipulator->SetModeActivationOnDetection (Standard_True);
|
||||
//! aManipulator->SetModeActivationOnDetection (true);
|
||||
//! @endcode
|
||||
//! Step 2. To perform transformation of object use next code in your event processing chain:
|
||||
//! @code
|
||||
@ -80,7 +76,7 @@ DEFINE_STANDARD_HANDLE(AIS_Manipulator, AIS_InteractiveObject)
|
||||
//! }
|
||||
//! ...
|
||||
//! // or catch mouse button up event (apply) or escape event (cancel)
|
||||
//! aManipulator->StopTransform(/*Standard_Boolean toApply*/);
|
||||
//! aManipulator->StopTransform(/*bool toApply*/);
|
||||
//! @endcode
|
||||
//! Step 3. To deactivate current manipulation mode use:
|
||||
//! @code aManipulator->DeactivateCurrentMode();
|
||||
@ -105,17 +101,16 @@ public:
|
||||
//! @warning Enabling or disabling of visual parts of manipulator does not manage the manipulation
|
||||
//! (selection) mode.
|
||||
//! @warning Raises program error if axis index is < 0 or > 2.
|
||||
Standard_EXPORT void SetPart(const Standard_Integer theAxisIndex,
|
||||
Standard_EXPORT void SetPart(const int theAxisIndex,
|
||||
const AIS_ManipulatorMode theMode,
|
||||
const Standard_Boolean theIsEnabled);
|
||||
const bool theIsEnabled);
|
||||
|
||||
//! Disable or enable visual parts for translation, rotation or scaling for ALL axes.
|
||||
//! By default all parts are enabled (will be displayed).
|
||||
//! @warning Enabling or disabling of visual parts of manipulator does not manage the manipulation
|
||||
//! (selection) mode.
|
||||
//! @warning Raises program error if axis index is < 0 or > 2.
|
||||
Standard_EXPORT void SetPart(const AIS_ManipulatorMode theMode,
|
||||
const Standard_Boolean theIsEnabled);
|
||||
Standard_EXPORT void SetPart(const AIS_ManipulatorMode theMode, const bool theIsEnabled);
|
||||
|
||||
//! Behavior settings to be applied when performing transformation:
|
||||
//! - FollowTranslation - whether the manipulator will be moved together with an object.
|
||||
@ -124,47 +119,48 @@ public:
|
||||
{
|
||||
|
||||
OptionsForAttach()
|
||||
: AdjustPosition(Standard_True),
|
||||
AdjustSize(Standard_False),
|
||||
EnableModes(Standard_True)
|
||||
: AdjustPosition(true),
|
||||
AdjustSize(false),
|
||||
EnableModes(true)
|
||||
{
|
||||
}
|
||||
|
||||
OptionsForAttach& SetAdjustPosition(const Standard_Boolean theApply)
|
||||
OptionsForAttach& SetAdjustPosition(const bool theApply)
|
||||
{
|
||||
AdjustPosition = theApply;
|
||||
return *this;
|
||||
}
|
||||
|
||||
OptionsForAttach& SetAdjustSize(const Standard_Boolean theApply)
|
||||
OptionsForAttach& SetAdjustSize(const bool theApply)
|
||||
{
|
||||
AdjustSize = theApply;
|
||||
return *this;
|
||||
}
|
||||
|
||||
OptionsForAttach& SetEnableModes(const Standard_Boolean theApply)
|
||||
OptionsForAttach& SetEnableModes(const bool theApply)
|
||||
{
|
||||
EnableModes = theApply;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Standard_Boolean AdjustPosition;
|
||||
Standard_Boolean AdjustSize;
|
||||
Standard_Boolean EnableModes;
|
||||
bool AdjustPosition;
|
||||
bool AdjustSize;
|
||||
bool EnableModes;
|
||||
};
|
||||
|
||||
//! Attaches himself to the input interactive object and become displayed in the same context.
|
||||
//! It is placed in the center of object bounding box, and its size is adjusted to the object
|
||||
//! bounding box.
|
||||
Standard_EXPORT void Attach(const Handle(AIS_InteractiveObject)& theObject,
|
||||
const OptionsForAttach& theOptions = OptionsForAttach());
|
||||
Standard_EXPORT void Attach(const occ::handle<AIS_InteractiveObject>& theObject,
|
||||
const OptionsForAttach& theOptions = OptionsForAttach());
|
||||
|
||||
//! Attaches himself to the input interactive object group and become displayed in the same
|
||||
//! context. It become attached to the first object, baut manage manipulation of the whole group.
|
||||
//! It is placed in the center of object bounding box, and its size is adjusted to the object
|
||||
//! bounding box.
|
||||
Standard_EXPORT void Attach(const Handle(AIS_ManipulatorObjectSequence)& theObject,
|
||||
const OptionsForAttach& theOptions = OptionsForAttach());
|
||||
Standard_EXPORT void Attach(
|
||||
const occ::handle<NCollection_HSequence<occ::handle<AIS_InteractiveObject>>>& theObject,
|
||||
const OptionsForAttach& theOptions = OptionsForAttach());
|
||||
|
||||
//! Enable manipualtion mode.
|
||||
//! @warning It activates selection mode in the current context.
|
||||
@ -174,13 +170,13 @@ public:
|
||||
//! Enables mode activation on detection (highlighting).
|
||||
//! By default, mode is activated on selection of manipulator part.
|
||||
//! @warning If this mode is enabled, selection of parts does nothing.
|
||||
void SetModeActivationOnDetection(const Standard_Boolean theToEnable)
|
||||
void SetModeActivationOnDetection(const bool theToEnable)
|
||||
{
|
||||
myIsActivationOnDetection = theToEnable;
|
||||
}
|
||||
|
||||
//! @return true if manual mode activation is enabled.
|
||||
Standard_Boolean IsModeActivationOnDetection() const { return myIsActivationOnDetection; }
|
||||
bool IsModeActivationOnDetection() const { return myIsActivationOnDetection; }
|
||||
|
||||
public:
|
||||
//! Drag object in the viewer.
|
||||
@ -191,22 +187,21 @@ public:
|
||||
//! @param[in] theDragTo drag end point
|
||||
//! @param[in] theAction drag action
|
||||
//! @return FALSE if object rejects dragging action (e.g. AIS_DragAction_Start)
|
||||
Standard_EXPORT virtual Standard_Boolean ProcessDragging(
|
||||
const Handle(AIS_InteractiveContext)& theCtx,
|
||||
const Handle(V3d_View)& theView,
|
||||
const Handle(SelectMgr_EntityOwner)& theOwner,
|
||||
const Graphic3d_Vec2i& theDragFrom,
|
||||
const Graphic3d_Vec2i& theDragTo,
|
||||
const AIS_DragAction theAction) Standard_OVERRIDE;
|
||||
Standard_EXPORT bool ProcessDragging(const occ::handle<AIS_InteractiveContext>& theCtx,
|
||||
const occ::handle<V3d_View>& theView,
|
||||
const occ::handle<SelectMgr_EntityOwner>& theOwner,
|
||||
const NCollection_Vec2<int>& theDragFrom,
|
||||
const NCollection_Vec2<int>& theDragTo,
|
||||
const AIS_DragAction theAction) override;
|
||||
|
||||
//! Init start (reference) transformation.
|
||||
//! @warning It is used in chain with StartTransform-Transform(gp_Trsf)-StopTransform
|
||||
//! and is used only for custom transform set. If Transform(const Standard_Integer, const
|
||||
//! Standard_Integer) is used, initial data is set automatically, and it is reset on
|
||||
//! and is used only for custom transform set. If Transform(const int, const
|
||||
//! int) is used, initial data is set automatically, and it is reset on
|
||||
//! DeactivateCurrentMode call if it is not reset yet.
|
||||
Standard_EXPORT void StartTransform(const Standard_Integer theX,
|
||||
const Standard_Integer theY,
|
||||
const Handle(V3d_View)& theView);
|
||||
Standard_EXPORT void StartTransform(const int theX,
|
||||
const int theY,
|
||||
const occ::handle<V3d_View>& theView);
|
||||
|
||||
//! Apply to the owning objects the input transformation.
|
||||
//! @remark The transformation is set using SetLocalTransformation for owning objects.
|
||||
@ -218,8 +213,8 @@ public:
|
||||
Standard_EXPORT void Transform(const gp_Trsf& aTrsf);
|
||||
|
||||
//! Apply camera transformation to flat skin manipulator
|
||||
Standard_EXPORT void RecomputeTransformation(const Handle(Graphic3d_Camera)& theCamera)
|
||||
Standard_OVERRIDE;
|
||||
Standard_EXPORT void RecomputeTransformation(
|
||||
const occ::handle<Graphic3d_Camera>& theCamera) override;
|
||||
|
||||
//! Recomputes sensitive primitives for the given selection mode.
|
||||
//! @param theMode selection mode to recompute sensitive primitives
|
||||
@ -229,23 +224,23 @@ public:
|
||||
//! @param[in] theToApply option to apply or to cancel the started transformation.
|
||||
//! @warning It is used in chain with StartTransform-Transform(gp_Trsf)-StopTransform
|
||||
//! and is used only for custom transform set.
|
||||
Standard_EXPORT void StopTransform(const Standard_Boolean theToApply = Standard_True);
|
||||
Standard_EXPORT void StopTransform(const bool theToApply = true);
|
||||
|
||||
//! Apply transformation made from mouse moving from start position
|
||||
//! (save on the first Transform() call and reset on DeactivateCurrentMode() call.)
|
||||
//! to the in/out mouse position (theX, theY)
|
||||
Standard_EXPORT gp_Trsf Transform(const Standard_Integer theX,
|
||||
const Standard_Integer theY,
|
||||
const Handle(V3d_View)& theView);
|
||||
Standard_EXPORT gp_Trsf Transform(const int theX,
|
||||
const int theY,
|
||||
const occ::handle<V3d_View>& theView);
|
||||
|
||||
//! Computes transformation of parent object according to the active mode and input motion vector.
|
||||
//! You can use this method to get object transformation according to current mode or use own
|
||||
//! algorithm to implement any other transformation for modes.
|
||||
//! @return transformation of parent object.
|
||||
Standard_EXPORT Standard_Boolean ObjectTransformation(const Standard_Integer theX,
|
||||
const Standard_Integer theY,
|
||||
const Handle(V3d_View)& theView,
|
||||
gp_Trsf& theTrsf);
|
||||
Standard_EXPORT bool ObjectTransformation(const int theX,
|
||||
const int theY,
|
||||
const occ::handle<V3d_View>& theView,
|
||||
gp_Trsf& theTrsf);
|
||||
|
||||
//! Make inactive the current selected manipulator part and reset current axis index and current
|
||||
//! mode. After its call HasActiveMode() returns false.
|
||||
@ -256,30 +251,31 @@ public:
|
||||
Standard_EXPORT void Detach();
|
||||
|
||||
//! @return all owning objects.
|
||||
Standard_EXPORT Handle(AIS_ManipulatorObjectSequence) Objects() const;
|
||||
Standard_EXPORT occ::handle<NCollection_HSequence<occ::handle<AIS_InteractiveObject>>> Objects()
|
||||
const;
|
||||
|
||||
//! @return the first (leading) object of the owning objects.
|
||||
Standard_EXPORT Handle(AIS_InteractiveObject) Object() const;
|
||||
Standard_EXPORT occ::handle<AIS_InteractiveObject> Object() const;
|
||||
|
||||
//! @return one of the owning objects.
|
||||
//! @warning raises program error if theIndex is more than owning objects count or less than 1.
|
||||
Standard_EXPORT Handle(AIS_InteractiveObject) Object(const Standard_Integer theIndex) const;
|
||||
Standard_EXPORT occ::handle<AIS_InteractiveObject> Object(const int theIndex) const;
|
||||
|
||||
//! @return true if manipulator is attached to some interactive object (has owning object).
|
||||
Standard_Boolean IsAttached() const { return HasOwner(); }
|
||||
bool IsAttached() const { return HasOwner(); }
|
||||
|
||||
//! @return true if some part of manipulator is selected (transformation mode is active, and
|
||||
//! owning object can be transformed).
|
||||
Standard_Boolean HasActiveMode() const { return IsAttached() && myCurrentMode != AIS_MM_None; }
|
||||
bool HasActiveMode() const { return IsAttached() && myCurrentMode != AIS_MM_None; }
|
||||
|
||||
Standard_Boolean HasActiveTransformation() { return myHasStartedTransformation; }
|
||||
bool HasActiveTransformation() { return myHasStartedTransformation; }
|
||||
|
||||
gp_Trsf StartTransformation() const
|
||||
{
|
||||
return !myStartTrsfs.IsEmpty() ? myStartTrsfs.First() : gp_Trsf();
|
||||
}
|
||||
|
||||
gp_Trsf StartTransformation(Standard_Integer theIndex) const
|
||||
gp_Trsf StartTransformation(int theIndex) const
|
||||
{
|
||||
Standard_ProgramError_Raise_if(
|
||||
theIndex < 1 || theIndex > Objects()->Upper(),
|
||||
@ -294,10 +290,10 @@ public: //! @name Configuration of graphical transformations
|
||||
//! properties and local transformation to achieve necessary visual effect.
|
||||
//! @warning revise use of AdjustSize argument of of \sa AttachToObjects method
|
||||
//! when enabling zoom persistence.
|
||||
Standard_EXPORT void SetZoomPersistence(const Standard_Boolean theToEnable);
|
||||
Standard_EXPORT void SetZoomPersistence(const bool theToEnable);
|
||||
|
||||
//! Returns state of zoom persistence mode, whether it turned on or off.
|
||||
Standard_Boolean ZoomPersistence() const { return myIsZoomPersistentMode; }
|
||||
bool ZoomPersistence() const { return myIsZoomPersistentMode; }
|
||||
|
||||
//! Redefines transform persistence management to setup transformation for sub-presentation of
|
||||
//! axes.
|
||||
@ -308,8 +304,8 @@ public: //! @name Configuration of graphical transformations
|
||||
//! ZoomPersistence mode, silently does nothing in release mode.
|
||||
//! @warning revise use of AdjustSize argument of of \sa AttachToObjects method
|
||||
//! when enabling zoom persistence.
|
||||
Standard_EXPORT virtual void SetTransformPersistence(
|
||||
const Handle(Graphic3d_TransformPers)& theTrsfPers) Standard_OVERRIDE;
|
||||
Standard_EXPORT void SetTransformPersistence(
|
||||
const occ::handle<Graphic3d_TransformPers>& theTrsfPers) override;
|
||||
|
||||
public: //! @name Setters for parameters
|
||||
enum ManipulatorSkin
|
||||
@ -326,7 +322,7 @@ public: //! @name Setters for parameters
|
||||
|
||||
AIS_ManipulatorMode ActiveMode() const { return myCurrentMode; }
|
||||
|
||||
Standard_Integer ActiveAxisIndex() const { return myCurrentIndex; }
|
||||
int ActiveAxisIndex() const { return myCurrentIndex; }
|
||||
|
||||
//! @return poition of manipulator interactive object.
|
||||
const gp_Ax2& Position() const { return myPosition; }
|
||||
@ -334,13 +330,13 @@ public: //! @name Setters for parameters
|
||||
//! Sets position of the manipulator object.
|
||||
Standard_EXPORT void SetPosition(const gp_Ax2& thePosition);
|
||||
|
||||
Standard_ShortReal Size() const { return myAxes[0].Size(); }
|
||||
float Size() const { return myAxes[0].Size(); }
|
||||
|
||||
//! Sets size (length of side of the manipulator cubic bounding box.
|
||||
Standard_EXPORT void SetSize(const Standard_ShortReal theSideLength);
|
||||
Standard_EXPORT void SetSize(const float theSideLength);
|
||||
|
||||
//! Sets gaps between translator, scaler and rotator sub-presentations.
|
||||
Standard_EXPORT void SetGap(const Standard_ShortReal theValue);
|
||||
Standard_EXPORT void SetGap(const float theValue);
|
||||
|
||||
public:
|
||||
//! Behavior settings to be applied when performing transformation:
|
||||
@ -350,33 +346,33 @@ public:
|
||||
{
|
||||
|
||||
BehaviorOnTransform()
|
||||
: FollowTranslation(Standard_True),
|
||||
FollowRotation(Standard_True),
|
||||
FollowDragging(Standard_True)
|
||||
: FollowTranslation(true),
|
||||
FollowRotation(true),
|
||||
FollowDragging(true)
|
||||
{
|
||||
}
|
||||
|
||||
BehaviorOnTransform& SetFollowTranslation(const Standard_Boolean theApply)
|
||||
BehaviorOnTransform& SetFollowTranslation(const bool theApply)
|
||||
{
|
||||
FollowTranslation = theApply;
|
||||
return *this;
|
||||
}
|
||||
|
||||
BehaviorOnTransform& SetFollowRotation(const Standard_Boolean theApply)
|
||||
BehaviorOnTransform& SetFollowRotation(const bool theApply)
|
||||
{
|
||||
FollowRotation = theApply;
|
||||
return *this;
|
||||
}
|
||||
|
||||
BehaviorOnTransform& SetFollowDragging(const Standard_Boolean theApply)
|
||||
BehaviorOnTransform& SetFollowDragging(const bool theApply)
|
||||
{
|
||||
FollowDragging = theApply;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Standard_Boolean FollowTranslation;
|
||||
Standard_Boolean FollowRotation;
|
||||
Standard_Boolean FollowDragging;
|
||||
bool FollowTranslation;
|
||||
bool FollowRotation;
|
||||
bool FollowDragging;
|
||||
};
|
||||
|
||||
//! Sets behavior settings for transformation action carried on the manipulator,
|
||||
@ -396,45 +392,45 @@ public: //! @name Presentation computation
|
||||
//! Fills presentation.
|
||||
//! @note Manipulator presentation does not use display mode and for all modes has the same
|
||||
//! presentation.
|
||||
Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager)& thePrsMgr,
|
||||
const Handle(Prs3d_Presentation)& thePrs,
|
||||
const Standard_Integer theMode = 0) Standard_OVERRIDE;
|
||||
Standard_EXPORT void Compute(const occ::handle<PrsMgr_PresentationManager>& thePrsMgr,
|
||||
const occ::handle<Prs3d_Presentation>& thePrs,
|
||||
const int theMode = 0) override;
|
||||
|
||||
//! Computes selection sensitive zones (triangulation) for manipulator.
|
||||
//! @param[in] theNode Selection mode that is treated as transformation mode.
|
||||
Standard_EXPORT virtual void ComputeSelection(const Handle(SelectMgr_Selection)& theSelection,
|
||||
const Standard_Integer theMode) Standard_OVERRIDE;
|
||||
Standard_EXPORT void ComputeSelection(const occ::handle<SelectMgr_Selection>& theSelection,
|
||||
const int theMode) override;
|
||||
|
||||
//! Disables auto highlighting to use HilightSelected() and HilightOwnerWithColor() overridden
|
||||
//! methods.
|
||||
virtual Standard_Boolean IsAutoHilight() const Standard_OVERRIDE { return Standard_False; }
|
||||
bool IsAutoHilight() const override { return false; }
|
||||
|
||||
//! Method which clear all selected owners belonging
|
||||
//! to this selectable object ( for fast presentation draw ).
|
||||
Standard_EXPORT virtual void ClearSelected() Standard_OVERRIDE;
|
||||
//! to this selectable object (for fast presentation draw).
|
||||
Standard_EXPORT void ClearSelected() override;
|
||||
|
||||
//! Method which draws selected owners ( for fast presentation draw ).
|
||||
Standard_EXPORT virtual void HilightSelected(const Handle(PrsMgr_PresentationManager)& thePM,
|
||||
const SelectMgr_SequenceOfOwner& theSeq)
|
||||
Standard_OVERRIDE;
|
||||
//! Method which draws selected owners (for fast presentation draw).
|
||||
Standard_EXPORT void HilightSelected(
|
||||
const occ::handle<PrsMgr_PresentationManager>& thePM,
|
||||
const NCollection_Sequence<occ::handle<SelectMgr_EntityOwner>>& theSeq) override;
|
||||
|
||||
//! Method which hilight an owner belonging to
|
||||
//! this selectable object ( for fast presentation draw ).
|
||||
Standard_EXPORT virtual void HilightOwnerWithColor(
|
||||
const Handle(PrsMgr_PresentationManager)& thePM,
|
||||
const Handle(Prs3d_Drawer)& theStyle,
|
||||
const Handle(SelectMgr_EntityOwner)& theOwner) Standard_OVERRIDE;
|
||||
//! this selectable object (for fast presentation draw).
|
||||
Standard_EXPORT void HilightOwnerWithColor(
|
||||
const occ::handle<PrsMgr_PresentationManager>& thePM,
|
||||
const occ::handle<Prs3d_Drawer>& theStyle,
|
||||
const occ::handle<SelectMgr_EntityOwner>& theOwner) override;
|
||||
|
||||
protected:
|
||||
Standard_EXPORT void init();
|
||||
|
||||
Standard_EXPORT void updateTransformation();
|
||||
|
||||
Standard_EXPORT Handle(Prs3d_Presentation) getHighlightPresentation(
|
||||
const Handle(SelectMgr_EntityOwner)& theOwner) const;
|
||||
Standard_EXPORT occ::handle<Prs3d_Presentation> getHighlightPresentation(
|
||||
const occ::handle<SelectMgr_EntityOwner>& theOwner) const;
|
||||
|
||||
Standard_EXPORT Handle(Graphic3d_Group) getGroup(const Standard_Integer theIndex,
|
||||
const AIS_ManipulatorMode theMode) const;
|
||||
Standard_EXPORT occ::handle<Graphic3d_Group> getGroup(const int theIndex,
|
||||
const AIS_ManipulatorMode theMode) const;
|
||||
|
||||
Standard_EXPORT void attachToPoint(const gp_Pnt& thePoint);
|
||||
|
||||
@ -442,7 +438,8 @@ protected:
|
||||
|
||||
Standard_EXPORT void adjustSize(const Bnd_Box& theBox);
|
||||
|
||||
Standard_EXPORT void setTransformPersistence(const Handle(Graphic3d_TransformPers)& theTrsfPers);
|
||||
Standard_EXPORT void setTransformPersistence(
|
||||
const occ::handle<Graphic3d_TransformPers>& theTrsfPers);
|
||||
|
||||
//! Redefines local transformation management method to inform user of improper use.
|
||||
//! @warning this interactive object does not support setting custom local transformation,
|
||||
@ -450,8 +447,7 @@ protected:
|
||||
//! without need for recomputing presentation.
|
||||
//! @warning Invokes debug assertion in debug to catch incompatible usage of the
|
||||
//! method, silently does nothing in release mode.
|
||||
Standard_EXPORT virtual void setLocalTransformation(const Handle(TopLoc_Datum3D)& theTrsf)
|
||||
Standard_OVERRIDE;
|
||||
Standard_EXPORT void setLocalTransformation(const occ::handle<TopLoc_Datum3D>& theTrsf) override;
|
||||
using AIS_InteractiveObject::SetLocalTransformation; // hide visibility
|
||||
|
||||
protected: //! @name Auxiliary classes to fill presentation with proper primitives
|
||||
@ -464,13 +460,13 @@ protected: //! @name Auxiliary classes to fill presentation with proper primitiv
|
||||
myArray.Nullify();
|
||||
}
|
||||
|
||||
const Handle(Poly_Triangulation)& Triangulation() const { return myTriangulation; }
|
||||
const occ::handle<Poly_Triangulation>& Triangulation() const { return myTriangulation; }
|
||||
|
||||
const Handle(Graphic3d_ArrayOfTriangles)& Array() const { return myArray; }
|
||||
const occ::handle<Graphic3d_ArrayOfTriangles>& Array() const { return myArray; }
|
||||
|
||||
protected:
|
||||
Handle(Poly_Triangulation) myTriangulation;
|
||||
Handle(Graphic3d_ArrayOfTriangles) myArray;
|
||||
occ::handle<Poly_Triangulation> myTriangulation;
|
||||
occ::handle<Graphic3d_ArrayOfTriangles> myArray;
|
||||
};
|
||||
|
||||
class Disk : public Quadric
|
||||
@ -483,19 +479,19 @@ protected: //! @name Auxiliary classes to fill presentation with proper primitiv
|
||||
{
|
||||
}
|
||||
|
||||
~Disk() {}
|
||||
~Disk() override = default;
|
||||
|
||||
void Init(const Standard_ShortReal theInnerRadius,
|
||||
const Standard_ShortReal theOuterRadius,
|
||||
const gp_Ax1& thePosition,
|
||||
const Standard_Real theAngle,
|
||||
const Standard_Integer theSlicesNb = 20,
|
||||
const Standard_Integer theStacksNb = 20);
|
||||
void Init(const float theInnerRadius,
|
||||
const float theOuterRadius,
|
||||
const gp_Ax1& thePosition,
|
||||
const double theAngle,
|
||||
const int theSlicesNb = 20,
|
||||
const int theStacksNb = 20);
|
||||
|
||||
protected:
|
||||
gp_Ax1 myPosition;
|
||||
Standard_ShortReal myInnerRad;
|
||||
Standard_ShortReal myOuterRad;
|
||||
gp_Ax1 myPosition;
|
||||
float myInnerRad;
|
||||
float myOuterRad;
|
||||
};
|
||||
|
||||
class Sphere : public Quadric
|
||||
@ -507,42 +503,40 @@ protected: //! @name Auxiliary classes to fill presentation with proper primitiv
|
||||
{
|
||||
}
|
||||
|
||||
void Init(const Standard_ShortReal theRadius,
|
||||
const gp_Pnt& thePosition,
|
||||
const ManipulatorSkin theSkinMode,
|
||||
const Standard_Integer theSlicesNb = 20,
|
||||
const Standard_Integer theStacksNb = 20);
|
||||
void Init(const float theRadius,
|
||||
const gp_Pnt& thePosition,
|
||||
const ManipulatorSkin theSkinMode,
|
||||
const int theSlicesNb = 20,
|
||||
const int theStacksNb = 20);
|
||||
|
||||
protected:
|
||||
gp_Pnt myPosition;
|
||||
Standard_ShortReal myRadius;
|
||||
gp_Pnt myPosition;
|
||||
float myRadius;
|
||||
};
|
||||
|
||||
class Cube
|
||||
{
|
||||
public:
|
||||
Cube() {}
|
||||
Cube() = default;
|
||||
|
||||
~Cube() {}
|
||||
~Cube() = default;
|
||||
|
||||
void Init(const gp_Ax1& thePosition,
|
||||
const Standard_ShortReal myBoxSize,
|
||||
const ManipulatorSkin theSkinMode);
|
||||
void Init(const gp_Ax1& thePosition, const float myBoxSize, const ManipulatorSkin theSkinMode);
|
||||
|
||||
const Handle(Poly_Triangulation)& Triangulation() const { return myTriangulation; }
|
||||
const occ::handle<Poly_Triangulation>& Triangulation() const { return myTriangulation; }
|
||||
|
||||
const Handle(Graphic3d_ArrayOfTriangles)& Array() const { return myArray; }
|
||||
const occ::handle<Graphic3d_ArrayOfTriangles>& Array() const { return myArray; }
|
||||
|
||||
private:
|
||||
void addTriangle(const Standard_Integer theIndex,
|
||||
const gp_Pnt& theP1,
|
||||
const gp_Pnt& theP2,
|
||||
const gp_Pnt& theP3,
|
||||
const gp_Dir& theNormal);
|
||||
void addTriangle(const int theIndex,
|
||||
const gp_Pnt& theP1,
|
||||
const gp_Pnt& theP2,
|
||||
const gp_Pnt& theP3,
|
||||
const gp_Dir& theNormal);
|
||||
|
||||
protected:
|
||||
Handle(Poly_Triangulation) myTriangulation;
|
||||
Handle(Graphic3d_ArrayOfTriangles) myArray;
|
||||
occ::handle<Poly_Triangulation> myTriangulation;
|
||||
occ::handle<Graphic3d_ArrayOfTriangles> myArray;
|
||||
};
|
||||
|
||||
class Sector : public Quadric
|
||||
@ -554,18 +548,18 @@ protected: //! @name Auxiliary classes to fill presentation with proper primitiv
|
||||
{
|
||||
}
|
||||
|
||||
~Sector() {}
|
||||
~Sector() override = default;
|
||||
|
||||
void Init(const Standard_ShortReal theRadius,
|
||||
const gp_Ax1& thePosition,
|
||||
const gp_Dir& theXDirection,
|
||||
const ManipulatorSkin theSkinMode,
|
||||
const Standard_Integer theSlicesNb = 5,
|
||||
const Standard_Integer theStacksNb = 5);
|
||||
void Init(const float theRadius,
|
||||
const gp_Ax1& thePosition,
|
||||
const gp_Dir& theXDirection,
|
||||
const ManipulatorSkin theSkinMode,
|
||||
const int theSlicesNb = 5,
|
||||
const int theStacksNb = 5);
|
||||
|
||||
protected:
|
||||
gp_Ax1 myPosition;
|
||||
Standard_ShortReal myRadius;
|
||||
gp_Ax1 myPosition;
|
||||
float myRadius;
|
||||
};
|
||||
|
||||
//! The class describes on axis sub-object.
|
||||
@ -576,14 +570,14 @@ protected: //! @name Auxiliary classes to fill presentation with proper primitiv
|
||||
class Axis
|
||||
{
|
||||
public:
|
||||
Axis(const gp_Ax1& theAxis = gp_Ax1(),
|
||||
const Quantity_Color& theColor = Quantity_Color(),
|
||||
const Standard_ShortReal theLength = 10.0f);
|
||||
Axis(const gp_Ax1& theAxis = gp_Ax1(),
|
||||
const Quantity_Color& theColor = Quantity_Color(),
|
||||
const float theLength = 10.0f);
|
||||
|
||||
void Compute(const Handle(PrsMgr_PresentationManager)& thePrsMgr,
|
||||
const Handle(Prs3d_Presentation)& thePrs,
|
||||
const Handle(Prs3d_ShadingAspect)& theAspect,
|
||||
const ManipulatorSkin theSkinMode);
|
||||
void Compute(const occ::handle<PrsMgr_PresentationManager>& thePrsMgr,
|
||||
const occ::handle<Prs3d_Presentation>& thePrs,
|
||||
const occ::handle<Prs3d_ShadingAspect>& theAspect,
|
||||
const ManipulatorSkin theSkinMode);
|
||||
|
||||
const gp_Ax1& ReferenceAxis() const { return myReferenceAxis; }
|
||||
|
||||
@ -591,7 +585,7 @@ protected: //! @name Auxiliary classes to fill presentation with proper primitiv
|
||||
|
||||
const gp_Ax1& Position() const { return myPosition; }
|
||||
|
||||
void SetTransformPersistence(const Handle(Graphic3d_TransformPers)& theTrsfPers)
|
||||
void SetTransformPersistence(const occ::handle<Graphic3d_TransformPers>& theTrsfPers)
|
||||
{
|
||||
if (!myHighlightTranslator.IsNull())
|
||||
{
|
||||
@ -614,7 +608,7 @@ protected: //! @name Auxiliary classes to fill presentation with proper primitiv
|
||||
}
|
||||
}
|
||||
|
||||
void Transform(const Handle(TopLoc_Datum3D)& theTransformation)
|
||||
void Transform(const occ::handle<TopLoc_Datum3D>& theTransformation)
|
||||
{
|
||||
if (!myHighlightTranslator.IsNull())
|
||||
{
|
||||
@ -637,60 +631,66 @@ protected: //! @name Auxiliary classes to fill presentation with proper primitiv
|
||||
}
|
||||
}
|
||||
|
||||
Standard_Boolean HasTranslation() const { return myHasTranslation; }
|
||||
bool HasTranslation() const { return myHasTranslation; }
|
||||
|
||||
Standard_Boolean HasRotation() const { return myHasRotation; }
|
||||
bool HasRotation() const { return myHasRotation; }
|
||||
|
||||
Standard_Boolean HasScaling() const { return myHasScaling; }
|
||||
bool HasScaling() const { return myHasScaling; }
|
||||
|
||||
Standard_Boolean HasDragging() const { return myHasDragging; }
|
||||
bool HasDragging() const { return myHasDragging; }
|
||||
|
||||
void SetTranslation(const Standard_Boolean theIsEnabled) { myHasTranslation = theIsEnabled; }
|
||||
void SetTranslation(const bool theIsEnabled) { myHasTranslation = theIsEnabled; }
|
||||
|
||||
void SetRotation(const Standard_Boolean theIsEnabled) { myHasRotation = theIsEnabled; }
|
||||
void SetRotation(const bool theIsEnabled) { myHasRotation = theIsEnabled; }
|
||||
|
||||
void SetScaling(const Standard_Boolean theIsEnabled) { myHasScaling = theIsEnabled; }
|
||||
void SetScaling(const bool theIsEnabled) { myHasScaling = theIsEnabled; }
|
||||
|
||||
void SetDragging(const Standard_Boolean theIsEnabled) { myHasDragging = theIsEnabled; }
|
||||
void SetDragging(const bool theIsEnabled) { myHasDragging = theIsEnabled; }
|
||||
|
||||
Quantity_Color Color() const { return myColor; }
|
||||
|
||||
Standard_ShortReal AxisLength() const { return myLength; }
|
||||
float AxisLength() const { return myLength; }
|
||||
|
||||
Standard_ShortReal BoxSize() const { return myBoxSize; }
|
||||
float BoxSize() const { return myBoxSize; }
|
||||
|
||||
Standard_ShortReal AxisRadius() const { return myAxisRadius; }
|
||||
float AxisRadius() const { return myAxisRadius; }
|
||||
|
||||
Standard_ShortReal Indent() const { return myIndent; }
|
||||
float Indent() const { return myIndent; }
|
||||
|
||||
void SetAxisRadius(const Standard_ShortReal theValue) { myAxisRadius = theValue; }
|
||||
void SetAxisRadius(const float theValue) { myAxisRadius = theValue; }
|
||||
|
||||
const Handle(Prs3d_Presentation)& TranslatorHighlightPrs() const
|
||||
const occ::handle<Prs3d_Presentation>& TranslatorHighlightPrs() const
|
||||
{
|
||||
return myHighlightTranslator;
|
||||
}
|
||||
|
||||
const Handle(Prs3d_Presentation)& RotatorHighlightPrs() const { return myHighlightRotator; }
|
||||
const occ::handle<Prs3d_Presentation>& RotatorHighlightPrs() const
|
||||
{
|
||||
return myHighlightRotator;
|
||||
}
|
||||
|
||||
const Handle(Prs3d_Presentation)& ScalerHighlightPrs() const { return myHighlightScaler; }
|
||||
const occ::handle<Prs3d_Presentation>& ScalerHighlightPrs() const { return myHighlightScaler; }
|
||||
|
||||
const Handle(Prs3d_Presentation)& DraggerHighlightPrs() const { return myHighlightDragger; }
|
||||
const occ::handle<Prs3d_Presentation>& DraggerHighlightPrs() const
|
||||
{
|
||||
return myHighlightDragger;
|
||||
}
|
||||
|
||||
const Handle(Graphic3d_Group)& TranslatorGroup() const { return myTranslatorGroup; }
|
||||
const occ::handle<Graphic3d_Group>& TranslatorGroup() const { return myTranslatorGroup; }
|
||||
|
||||
const Handle(Graphic3d_Group)& RotatorGroup() const { return myRotatorGroup; }
|
||||
const occ::handle<Graphic3d_Group>& RotatorGroup() const { return myRotatorGroup; }
|
||||
|
||||
const Handle(Graphic3d_Group)& ScalerGroup() const { return myScalerGroup; }
|
||||
const occ::handle<Graphic3d_Group>& ScalerGroup() const { return myScalerGroup; }
|
||||
|
||||
const Handle(Graphic3d_Group)& DraggerGroup() const { return myDraggerGroup; }
|
||||
const occ::handle<Graphic3d_Group>& DraggerGroup() const { return myDraggerGroup; }
|
||||
|
||||
const Handle(Graphic3d_ArrayOfTriangles)& TriangleArray() const { return myTriangleArray; }
|
||||
const occ::handle<Graphic3d_ArrayOfTriangles>& TriangleArray() const { return myTriangleArray; }
|
||||
|
||||
void SetIndent(const Standard_ShortReal theValue) { myIndent = theValue; }
|
||||
void SetIndent(const float theValue) { myIndent = theValue; }
|
||||
|
||||
Standard_ShortReal Size() const { return myInnerRadius + myDiskThickness + myIndent * 2; }
|
||||
float Size() const { return myInnerRadius + myDiskThickness + myIndent * 2; }
|
||||
|
||||
Standard_ShortReal InnerRadius() const { return myInnerRadius + myIndent * 2.0f; }
|
||||
float InnerRadius() const { return myInnerRadius + myIndent * 2.0f; }
|
||||
|
||||
gp_Pnt ScalerCenter(const gp_Pnt& theLocation) const
|
||||
{
|
||||
@ -698,7 +698,7 @@ protected: //! @name Auxiliary classes to fill presentation with proper primitiv
|
||||
+ myPosition.Direction().XYZ() * (myLength + myIndent + myBoxSize * 0.5f);
|
||||
}
|
||||
|
||||
void SetSize(const Standard_ShortReal theValue)
|
||||
void SetSize(const float theValue)
|
||||
{
|
||||
if (myIndent > theValue * 0.1f)
|
||||
{
|
||||
@ -709,16 +709,16 @@ protected: //! @name Auxiliary classes to fill presentation with proper primitiv
|
||||
}
|
||||
else // use pre-set value of predent
|
||||
{
|
||||
Standard_ShortReal aLength = theValue - 2 * myIndent;
|
||||
myLength = aLength * 0.8f;
|
||||
myBoxSize = aLength * 0.15f;
|
||||
myDiskThickness = aLength * 0.05f;
|
||||
float aLength = theValue - 2 * myIndent;
|
||||
myLength = aLength * 0.8f;
|
||||
myBoxSize = aLength * 0.15f;
|
||||
myDiskThickness = aLength * 0.05f;
|
||||
}
|
||||
myInnerRadius = myIndent * 2 + myBoxSize + myLength;
|
||||
myAxisRadius = myBoxSize / 4.0f;
|
||||
}
|
||||
|
||||
Standard_Integer FacettesNumber() const { return myFacettesNumber; }
|
||||
int FacettesNumber() const { return myFacettesNumber; }
|
||||
|
||||
public:
|
||||
const gp_Pnt& TranslatorTipPosition() const { return myArrowTipPos; }
|
||||
@ -738,22 +738,22 @@ protected: //! @name Auxiliary classes to fill presentation with proper primitiv
|
||||
gp_Ax1 myPosition; //!< Position of the axis including local transformation.
|
||||
Quantity_Color myColor;
|
||||
|
||||
Standard_Boolean myHasTranslation;
|
||||
Standard_ShortReal myLength; //!< Length of translation axis.
|
||||
Standard_ShortReal myAxisRadius;
|
||||
bool myHasTranslation;
|
||||
float myLength; //!< Length of translation axis.
|
||||
float myAxisRadius;
|
||||
|
||||
Standard_Boolean myHasScaling;
|
||||
Standard_ShortReal myBoxSize; //!< Size of scaling cube.
|
||||
bool myHasScaling;
|
||||
float myBoxSize; //!< Size of scaling cube.
|
||||
|
||||
Standard_Boolean myHasRotation;
|
||||
Standard_ShortReal myInnerRadius; //!< Radius of rotation circle.
|
||||
Standard_ShortReal myDiskThickness;
|
||||
Standard_ShortReal myIndent; //!< Gap between visual part of the manipulator.
|
||||
bool myHasRotation;
|
||||
float myInnerRadius; //!< Radius of rotation circle.
|
||||
float myDiskThickness;
|
||||
float myIndent; //!< Gap between visual part of the manipulator.
|
||||
|
||||
Standard_Boolean myHasDragging;
|
||||
bool myHasDragging;
|
||||
|
||||
protected:
|
||||
Standard_Integer myFacettesNumber;
|
||||
int myFacettesNumber;
|
||||
|
||||
gp_Pnt myArrowTipPos;
|
||||
Sector mySector;
|
||||
@ -762,53 +762,53 @@ protected: //! @name Auxiliary classes to fill presentation with proper primitiv
|
||||
Cube myCube;
|
||||
gp_Pnt myCubePos;
|
||||
|
||||
Handle(Graphic3d_Group) myTranslatorGroup;
|
||||
Handle(Graphic3d_Group) myScalerGroup;
|
||||
Handle(Graphic3d_Group) myRotatorGroup;
|
||||
Handle(Graphic3d_Group) myDraggerGroup;
|
||||
occ::handle<Graphic3d_Group> myTranslatorGroup;
|
||||
occ::handle<Graphic3d_Group> myScalerGroup;
|
||||
occ::handle<Graphic3d_Group> myRotatorGroup;
|
||||
occ::handle<Graphic3d_Group> myDraggerGroup;
|
||||
|
||||
Handle(Prs3d_Presentation) myHighlightTranslator;
|
||||
Handle(Prs3d_Presentation) myHighlightScaler;
|
||||
Handle(Prs3d_Presentation) myHighlightRotator;
|
||||
Handle(Prs3d_Presentation) myHighlightDragger;
|
||||
occ::handle<Prs3d_Presentation> myHighlightTranslator;
|
||||
occ::handle<Prs3d_Presentation> myHighlightScaler;
|
||||
occ::handle<Prs3d_Presentation> myHighlightRotator;
|
||||
occ::handle<Prs3d_Presentation> myHighlightDragger;
|
||||
|
||||
Handle(Graphic3d_ArrayOfTriangles) myTriangleArray;
|
||||
occ::handle<Graphic3d_ArrayOfTriangles> myTriangleArray;
|
||||
};
|
||||
|
||||
protected:
|
||||
Axis myAxes[3]; //!< Tree axes of the manipulator.
|
||||
Sphere myCenter; //!< Visual part displaying the center sphere of the manipulator.
|
||||
// clang-format off
|
||||
Axis myAxes[3]; //!< Tree axes of the manipulator.
|
||||
Sphere myCenter; //!< Visual part displaying the center sphere of the manipulator.
|
||||
// clang-format off
|
||||
gp_Ax2 myPosition; //!< Position of the manipulator object. it displays its location and position of its axes.
|
||||
|
||||
Disk myCircle; //!< Outer circle
|
||||
Handle(Graphic3d_Group) myCircleGroup;
|
||||
occ::handle<Graphic3d_Group> myCircleGroup;
|
||||
|
||||
Disk mySector; //!< Sector indicating the rotation angle
|
||||
Handle(Graphic3d_Group) mySectorGroup;
|
||||
occ::handle<Graphic3d_Group> mySectorGroup;
|
||||
|
||||
Standard_Integer myCurrentIndex; //!< Index of active axis.
|
||||
int myCurrentIndex; //!< Index of active axis.
|
||||
AIS_ManipulatorMode myCurrentMode; //!< Name of active manipulation mode.
|
||||
ManipulatorSkin mySkinMode; //!< Name of active skin mode.
|
||||
|
||||
Standard_Boolean myIsActivationOnDetection; //!< Manual activation of modes (not on parts selection).
|
||||
Standard_Boolean myIsZoomPersistentMode; //!< Zoom persistence mode activation.
|
||||
bool myIsActivationOnDetection; //!< Manual activation of modes (not on parts selection).
|
||||
bool myIsZoomPersistentMode; //!< Zoom persistence mode activation.
|
||||
BehaviorOnTransform myBehaviorOnTransform; //!< Behavior settings applied on manipulator when transforming an object.
|
||||
|
||||
protected: //! @name Fields for interactive transformation. Fields only for internal needs. They do not have public interface.
|
||||
|
||||
NCollection_Sequence<gp_Trsf> myStartTrsfs; //!< Owning object transformation for start. It is used internally.
|
||||
Standard_Boolean myHasStartedTransformation; //!< Shows if transformation is processed (sequential calls of Transform()).
|
||||
// clang-format on
|
||||
gp_Ax2 myStartPosition; //! Start position of manipulator.
|
||||
gp_Pnt myStartPick; //! 3d point corresponding to start mouse pick.
|
||||
Standard_Real myPrevState; //! Previous value of angle during rotation.
|
||||
bool myHasStartedTransformation; //!< Shows if transformation is processed (sequential calls of Transform()).
|
||||
// clang-format on
|
||||
gp_Ax2 myStartPosition; //! Start position of manipulator.
|
||||
gp_Pnt myStartPick; //! 3d point corresponding to start mouse pick.
|
||||
double myPrevState; //! Previous value of angle during rotation.
|
||||
|
||||
//! Aspect used to color current detected part and current selected part.
|
||||
Handle(Prs3d_ShadingAspect) myHighlightAspect;
|
||||
occ::handle<Prs3d_ShadingAspect> myHighlightAspect;
|
||||
|
||||
//! Aspect used to color sector part when it's selected.
|
||||
Handle(Prs3d_ShadingAspect) myDraggerHighlight;
|
||||
occ::handle<Prs3d_ShadingAspect> myDraggerHighlight;
|
||||
|
||||
public:
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_Manipulator, AIS_InteractiveObject)
|
||||
|
||||
@ -16,12 +16,10 @@
|
||||
#ifndef _AIS_ManipulatorOwner_HeaderFile
|
||||
#define _AIS_ManipulatorOwner_HeaderFile
|
||||
|
||||
#include "AIS_Manipulator.hxx"
|
||||
#include <AIS_Manipulator.hxx>
|
||||
|
||||
#include "SelectMgr_EntityOwner.hxx"
|
||||
#include "SelectMgr_SelectableObject.hxx"
|
||||
|
||||
DEFINE_STANDARD_HANDLE(AIS_ManipulatorOwner, SelectMgr_EntityOwner)
|
||||
#include <SelectMgr_EntityOwner.hxx>
|
||||
#include <SelectMgr_SelectableObject.hxx>
|
||||
|
||||
//! Entity owner for selection management of AIS_Manipulator object.
|
||||
class AIS_ManipulatorOwner : public SelectMgr_EntityOwner
|
||||
@ -29,29 +27,28 @@ class AIS_ManipulatorOwner : public SelectMgr_EntityOwner
|
||||
public:
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_ManipulatorOwner, SelectMgr_EntityOwner)
|
||||
|
||||
Standard_EXPORT AIS_ManipulatorOwner(const Handle(SelectMgr_SelectableObject)& theSelObject,
|
||||
const Standard_Integer theIndex,
|
||||
const AIS_ManipulatorMode theMode,
|
||||
const Standard_Integer thePriority = 0);
|
||||
Standard_EXPORT AIS_ManipulatorOwner(const occ::handle<SelectMgr_SelectableObject>& theSelObject,
|
||||
const int theIndex,
|
||||
const AIS_ManipulatorMode theMode,
|
||||
const int thePriority = 0);
|
||||
|
||||
Standard_EXPORT virtual void HilightWithColor(const Handle(PrsMgr_PresentationManager)& thePM,
|
||||
const Handle(Prs3d_Drawer)& theStyle,
|
||||
const Standard_Integer theMode) Standard_OVERRIDE;
|
||||
Standard_EXPORT void HilightWithColor(const occ::handle<PrsMgr_PresentationManager>& thePM,
|
||||
const occ::handle<Prs3d_Drawer>& theStyle,
|
||||
const int theMode) override;
|
||||
|
||||
Standard_EXPORT Standard_Boolean
|
||||
IsHilighted(const Handle(PrsMgr_PresentationManager)& thePM,
|
||||
const Standard_Integer theMode) const Standard_OVERRIDE;
|
||||
Standard_EXPORT bool IsHilighted(const occ::handle<PrsMgr_PresentationManager>& thePM,
|
||||
const int theMode) const override;
|
||||
|
||||
Standard_EXPORT virtual void Unhilight(const Handle(PrsMgr_PresentationManager)& thePM,
|
||||
const Standard_Integer theMode) Standard_OVERRIDE;
|
||||
Standard_EXPORT void Unhilight(const occ::handle<PrsMgr_PresentationManager>& thePM,
|
||||
const int theMode) override;
|
||||
|
||||
AIS_ManipulatorMode Mode() const { return myMode; }
|
||||
|
||||
//! @return index of manipulator axis.
|
||||
Standard_Integer Index() const { return myIndex; }
|
||||
int Index() const { return myIndex; }
|
||||
|
||||
protected:
|
||||
Standard_Integer myIndex; //!< index of manipulator axis.
|
||||
int myIndex; //!< index of manipulator axis.
|
||||
AIS_ManipulatorMode myMode; //!< manipulation (highlight) mode.
|
||||
};
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user