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