vtkMapper相关类的分析及重写vtkMapper实现自定义的一些效果 (1)vtkAbstractMapper3D
2009-08-16 11:33
465 查看
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkAbstractMapper3D.h"
#include "vtkDataSet.h"
#include "vtkMath.h"
vtkCxxRevisionMacro(vtkAbstractMapper3D, "$Revision: 1.19 $");
// Construct with initial range (0,1).
vtkAbstractMapper3D::vtkAbstractMapper3D()
{
vtkMath::UninitializeBounds(this->Bounds);//把包围盒初始化
this->Center[0] = this->Center[1] = this->Center[2] = 0.0;
}
// Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
void vtkAbstractMapper3D::GetBounds(double bounds[6])//返回此Mapper的包围盒
{
this->GetBounds();
for (int i=0; i<6; i++)
{
bounds[i] = this->Bounds[i];
}
}
double *vtkAbstractMapper3D::GetCenter()//得到包围盒的中心
{
this->GetBounds();
for (int i=0; i<3; i++)
{
this->Center[i] = (this->Bounds[2*i+1] + this->Bounds[2*i]) / 2.0;
}
return this->Center;
}
double vtkAbstractMapper3D::GetLength()//得到包围盒对角线的长度,其实也是物体包围球的半径
{
double diff, l=0.0;
int i;
this->GetBounds();
for (i=0; i<3; i++)
{
diff = this->Bounds[2*i+1] - this->Bounds[2*i];
l += diff * diff;
}
return sqrt(l);
}
void vtkAbstractMapper3D::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
}
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkAbstractMapper3D.h"
#include "vtkDataSet.h"
#include "vtkMath.h"
vtkCxxRevisionMacro(vtkAbstractMapper3D, "$Revision: 1.19 $");
// Construct with initial range (0,1).
vtkAbstractMapper3D::vtkAbstractMapper3D()
{
vtkMath::UninitializeBounds(this->Bounds);//把包围盒初始化
this->Center[0] = this->Center[1] = this->Center[2] = 0.0;
}
// Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
void vtkAbstractMapper3D::GetBounds(double bounds[6])//返回此Mapper的包围盒
{
this->GetBounds();
for (int i=0; i<6; i++)
{
bounds[i] = this->Bounds[i];
}
}
double *vtkAbstractMapper3D::GetCenter()//得到包围盒的中心
{
this->GetBounds();
for (int i=0; i<3; i++)
{
this->Center[i] = (this->Bounds[2*i+1] + this->Bounds[2*i]) / 2.0;
}
return this->Center;
}
double vtkAbstractMapper3D::GetLength()//得到包围盒对角线的长度,其实也是物体包围球的半径
{
double diff, l=0.0;
int i;
this->GetBounds();
for (i=0; i<3; i++)
{
diff = this->Bounds[2*i+1] - this->Bounds[2*i];
l += diff * diff;
}
return sqrt(l);
}
void vtkAbstractMapper3D::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
}
相关文章推荐
- 分析自定义view的实现过程-实现雪花飞舞效果(转载有改动)
- 分析自定义view的实现过程-实现雪花飞舞效果
- 自定义View时,用到Paint Canvas的一些温故,讲讲用路径绘画实现动画效果(基础篇 三)
- 分析自定义view的实现过程-实现雪花飞舞效果(转载有改动)
- 自定义viewgroup实现自动换行的布局,同时解决自定义布局在wrapcontent下高度不能自适应的问题,plus一些关于Component重写的基础知识
- 自定义View时,用到Paint Canvas的一些温故,讲讲用路径绘画实现动画效果(基础篇 三)
- 写出高效清晰Layout布局文件的一些技巧--------自定义CoordinatorLayout:实现淘宝和QQ ToolBar透明渐变效果-------自定义Coordi快速返回效果
- [重写默认的4个权限设置相关的类:一]实现自定义用户配置提供程序ProfileProvider(转载)
- Android中自定义View实现圆环等待及相关的音量调节效果
- android 实现拉出回弹效果通过自定义ListView重写overScrollBy()
- 互联网的一些常用实现原理分析及代码实现(一):图片放大镜效果
- 利用CSS3实现文本框的清除按钮相关的一些效果
- Json反序列化之ObjectMapper(自定义实现反序列化方法)
- jquery自定义插件来实现分页的效果
- Android自定义View使用canvas实现轮播图效果
- Material Design一些效果实现
- 自定义View+Handle 实现模拟时钟效果
- android 自定义view实现类似圆盘抽奖的效果
- Android开发之ViewPager实现轮播图(轮播广告)效果的自定义View
- Android自定义view实现太极效果