当前位置:网站首页>VTK. Le bouton gauche de la souris JS glisse pour changer le niveau et la largeur de la fenêtre
VTK. Le bouton gauche de la souris JS glisse pour changer le niveau et la largeur de la fenêtre
2022-06-23 07:53:00 【Xiaojiang River 12】
var that = this;
function DragObj(selector) {
//Enregistrer le noeud
this.ele = $(selector).get(0);
//AppelezstartDrag
this.startDrag();
}
/*EncapsulationstartDragMéthodes*/
DragObj.prototype.startDrag = function () {
var self = this;
//Ajouter au noeud de l'objet courantmousedownÉvénements,Faites glisser l'événement après avoir appuyé sur la souris
$(self.ele).on({
mousedown: function () {
self.drag();
}
})
}
/*Encapsulation des événements de glissement*/
DragObj.prototype.drag = function () {
var self = this;
/*Initialisationself.newDisance*/
self.newDisance = {
X:that.vtkObj['imageActorI'].getProperty().getColorLevel(),
Y:that.vtkObj['imageActorI'].getProperty().getColorWindow()
}
//Voilà.X Objets de fenêtre Ajouter des événements de déplacement et de fin
$('#contentX').on({
/* Déterminer si l'appareil augmente ou diminue l'échelle grise en fonction de la distance parcourue ,A gauche et à droitewl,Vers le haut et vers le basww*/
mousemove: function (oEvent) {
if(self.disance && self.disance.X){
self.newDisance.X = that.vtkObj['imageActorI'].getProperty().getColorLevel() + (oEvent.pageX - self.disance.X);
self.newDisance.Y = that.vtkObj['imageActorI'].getProperty().getColorWindow() + (oEvent.pageY - self.disance.Y);
}
self.disance = {
X: oEvent.pageX,
Y: oEvent.pageY
};
// Plan sagittal ,Le plan Coronal, Le plan axial modifie simultanément la position et la largeur de la fenêtre
['X','Y','Z'].forEach((type) => {
that.vtkObj['imageActor' + that.typeMap[type]].getProperty().setColorLevel(self.newDisance.X);
that.vtkObj['imageActor' + that.typeMap[type]].getProperty().setColorWindow(self.newDisance.Y);
})
$(".colorLevel").val(self.newDisance.X);
$(".colorWindow").val(self.newDisance.Y);
},
mouseup: function () {
/* Réinitialiser la distance après avoir relâché la souris , Laissez - le recalculer */
self.disance = {};
self.newDisance = {
X:that.vtkObj['imageActorI'].getProperty().getColorLevel(),
Y:that.vtkObj['imageActorI'].getProperty().getColorWindow()
};
$("#contentX").off('mousemove mouseup');
}
})
}
new DragObj('#contentX');
边栏推荐
- 转盘式视觉筛选机及其图像识别系统
- RTMP streaming exception fast recovery scheme
- Ers function display of SAP mm
- Eureka服务注册与发现
- [kubernetes] download address of the latest version of each major version of kubernetes
- Apache Solr 任意文件读取复现
- QT reading XML files using qdomdocument
- 【Kubernetes】Kubernetes各大版本的最新版本下载地址
- 深度学习------不同方法实现vgg16
- ArcMap batch delete points closer
猜你喜欢

Apache Solr 任意文件读取复现

Introduction to Excel VBA and practical examples

【Try to Hack】ip地址

Qt工程报错:-1: error: Cannot run compiler ‘clang++‘. Output:mingw32-make.exe
![Acwing game 56 [End]](/img/f6/cd650331c819a27f17c9ce6cd0c569.png)
Acwing game 56 [End]

MIT CMS.300 Session 12 – IDENTITY CONSTRUCTION 虚拟世界中身份认同的建立 part 2

vtk.js鼠标左键滑动改变窗位和窗宽

The road to hcip MPLS

The Sandbox 与《足球小将》达成合作,将流行的足球漫画及动画带入元宇宙
![[deep learning] [original] how to detect targets and draw map and other parameter maps without yolov5 weights or models](/img/f3/ff14cb5439a24e26f977e5f0d15785.png)
[deep learning] [original] how to detect targets and draw map and other parameter maps without yolov5 weights or models
随机推荐
Mathematical knowledge: Euler function - Euler function
Ers function display of SAP mm
[pit stepping record] a pit where the database connection is not closed and resources are released
mysql中多表视图性能疑惑
QT reading XML files using qdomdocument
浅析 Open API 设计规范
2. probability theory - axiom of probability theory
EXCEL VBA 入门与实用例子
Decoding and practice of cmaf Technology
C WPF realizes dynamic loading of controls through binding
HCIP之路第八次实验
openni.utils.OpenNIError: (OniStatus.ONI_STATUS_ERROR, b‘DeviceOpen using default: no devices found‘
php序列化和反序列化-ctf
unity 音频可视化方案
ArcMap batch delete points closer
数学知识:快速幂求逆元—快速幂
某年某月某公司的面试题(1)
[interface automation] software testing the core skills of salary increase to increase salary by 200%
google常用语法
Judge black production based on CDN and client slow log characteristics