Commit 93b064b4 authored by zmoelnig's avatar zmoelnig
Browse files

static_cast<int> of Geos

git-svn-id: https://pd-gem.svn.sourceforge.net/svnroot/pd-gem/trunk/Gem@3065 49b2a0ca-c541-4d49-a7ef-d785e4371512
parent 02d87cb8
......@@ -106,5 +106,5 @@ void curve :: obj_setupCallback(t_class *classPtr)
}
void curve :: resolutionMessCallback(void *data, t_floatarg res)
{
GetMyClass(data)->resolutionMess((int)res);
GetMyClass(data)->resolutionMess(static_cast<int>(res));
}
......@@ -41,8 +41,8 @@ curve3d :: curve3d(t_floatarg sizeX,t_floatarg sizeY )
{
int i, j, a;
nb_pts_control_X = MAX(2, (int)sizeX);
nb_pts_control_Y = MAX(2, (int)sizeY);
nb_pts_control_X = MAX(2, static_cast<int>(sizeX));
nb_pts_control_Y = MAX(2, static_cast<int>(sizeY));
m_posXYZ = new t_float3[nb_pts_control_X*nb_pts_control_Y];
......@@ -556,14 +556,15 @@ void curve3d :: obj_setupCallback(t_class *classPtr){
void curve3d :: resolutionMessCallback(void *data, t_floatarg resX, t_floatarg resY)
{
GetMyClass(data)->resolutionMess((int)resX, (int)resY);
GetMyClass(data)->resolutionMess(static_cast<int>(resX), static_cast<int>(resY));
}
void curve3d :: gridMessCallback(void *data, t_floatarg gridX, t_floatarg gridY)
{
GetMyClass(data)->gridMess((int)gridX, (int)gridY);
GetMyClass(data)->gridMess(static_cast<int>(gridX), static_cast<int>(gridY));
}
void curve3d :: setMessCallback(void *data, float X, float Y, float posX, float posY, float posZ)
{
GetMyClass(data)->setMess((int)X, (int)Y, posX, posY, posZ);
GetMyClass(data)->setMess(static_cast<int>(X), static_cast<int>(Y),
posX, posY, posZ);
}
......@@ -42,12 +42,12 @@ disk :: disk(int argc, t_atom *argv)
switch(argc){
case 3:
size = atom_getfloat(&argv[0]);
numSlices = (int)atom_getfloat(&argv[1]);
numSlices = atom_getint(&argv[1]);
m_innerRadius = atom_getfloat(&argv[2]);
break;
case 2:
size = atom_getfloat(&argv[0]);
numSlices = (int)atom_getfloat(&argv[1]);
numSlices = atom_getint(&argv[1]);
break;
case 1:
size = atom_getfloat(&argv[0]);
......
......@@ -262,7 +262,7 @@ void model :: openMessCallback(void *data, t_symbol *filename)
}
void model :: rescaleMessCallback(void *data, t_floatarg state)
{
GetMyClass(data)->rescaleMess((int)state);
GetMyClass(data)->rescaleMess(static_cast<int>(state));
}
void model :: smoothMessCallback(void *data, t_floatarg smooth)
{
......@@ -270,18 +270,18 @@ void model :: smoothMessCallback(void *data, t_floatarg smooth)
}
void model :: reverseMessCallback(void *data, t_floatarg state)
{
GetMyClass(data)->reverseMess((int)state);
GetMyClass(data)->reverseMess(static_cast<int>(state));
}
void model :: textureMessCallback(void *data, t_floatarg state)
{
GetMyClass(data)->textureMess((int)state);
GetMyClass(data)->textureMess(static_cast<int>(state));
}
void model :: materialMessCallback(void *data, t_floatarg state)
{
GetMyClass(data)->materialMess((int)state);
GetMyClass(data)->materialMess(static_cast<int>(state));
}
void model :: groupMessCallback(void *data, t_floatarg state)
{
GetMyClass(data)->groupMess((int)state);
GetMyClass(data)->groupMess(static_cast<int>(state));
}
......@@ -36,19 +36,22 @@ multimodel :: multimodel(t_symbol *filename, t_floatarg baseModel,
m_rescaleModel(1),
m_textype(GLM_TEX_DEFAULT),
m_rebuild(true),
m_currentH(1.f), m_currentW(1.f)
m_currentH(1.f), m_currentW(1.f)
{
inlet_new(this->x_obj, &this->x_obj->ob_pd, &s_float, gensym("mdl_num"));
// make sure that there are some characters
if (filename->s_name[0]) {
if (skipRate == 0) {
if (topModel == 0)
openMess(filename, 0, (int)baseModel, 1);
int skipRatei=static_cast<int>(skipRate);
int topModeli=static_cast<int>(topModel);
int baseModeli=static_cast<int>(baseModel);
if (skipRatei == 0) {
if (topModeli == 0)
openMess(filename, 0, baseModeli, 1);
else
openMess(filename, (int)baseModel, (int)topModel, 1);
openMess(filename, baseModeli, topModeli, 1);
}
else openMess(filename, (int)baseModel, (int)topModel, (int)skipRate);
else openMess(filename, baseModeli, topModeli, skipRatei);
}
}
......@@ -334,25 +337,29 @@ void multimodel :: obj_setupCallback(t_class *classPtr)
void multimodel :: openMessCallback(void *data, t_symbol *filename, t_floatarg baseModel,
t_floatarg topModel, t_floatarg skipRate)
{
if ((int)skipRate == 0)
int skipRatei=static_cast<int>(skipRate);
int topModeli=static_cast<int>(topModel);
int baseModeli=static_cast<int>(baseModel);
if (skipRatei == 0)
{
if ((int)topModel == 0)
GetMyClass(data)->openMess(filename, 0, (int)topModel, 0);
if (topModeli == 0)
GetMyClass(data)->openMess(filename, 0, topModeli, 0);
else
GetMyClass(data)->openMess(filename, (int)baseModel, (int)topModel, 0);
GetMyClass(data)->openMess(filename, baseModeli, topModeli, 0);
}
else
GetMyClass(data)->openMess(filename, (int)baseModel, (int)topModel, (int)skipRate);
GetMyClass(data)->openMess(filename, baseModeli, topModeli, skipRatei);
}
void multimodel :: changeModelCallback(void *data, t_floatarg modelNum)
{
GetMyClass(data)->changeModel((int)modelNum);
GetMyClass(data)->changeModel(static_cast<int>(modelNum));
}
void multimodel :: rescaleMessCallback(void *data, t_floatarg state)
{
GetMyClass(data)->rescaleMess((int)state);
GetMyClass(data)->rescaleMess(static_cast<int>(state));
}
void multimodel :: textureMessCallback(void *data, t_floatarg state)
{
GetMyClass(data)->textureMess((int)state);
GetMyClass(data)->textureMess(static_cast<int>(state));
}
......@@ -34,14 +34,14 @@ CPPEXTERN_NEW_WITH_ONE_ARG(polygon, t_floatarg, A_DEFFLOAT)
/////////////////////////////////////////////////////////
polygon :: polygon(t_floatarg numInputs)
: GemShape(),
m_numVertices(0),
m_numVertices(0),
m_vertarray(NULL),
m_vert(NULL),
m_numInputs(0),
m_inlet(NULL)
m_vert(NULL),
m_numInputs(0),
m_inlet(NULL)
{
int i;
int realNum = (int)numInputs;
int realNum = static_cast<int>(numInputs);
// configure the inlets
if(realNum>0) {
......
......@@ -28,13 +28,15 @@ ripple :: ripple( t_floatarg gridX, t_floatarg gridY )
m_ctrX(0.f), m_ctrY(0.f),
m_height(1.0),
m_inletH(NULL), m_inletcX(NULL), m_inletcY(NULL),
m_gridX((int)gridX), m_gridY((int)gridY),
m_gridX(0), m_gridY(0),
m_alreadyInit(false),
m_sizeX(0.f), m_sizeY(0.f), m_sizeY0(0.f)
{
m_gridX=(gridX>0.&&gridX<GRID_MAX_X)?(int)gridX:GRID_SIZE_X;
m_gridY=(gridY>0.&&gridX<GRID_MAX_Y)?(int)gridY:GRID_SIZE_Y;
int gridXi=static_cast<int>(gridX);
int gridYi=static_cast<int>(gridY);
m_gridX=(gridXi>0&&gridXi<GRID_MAX_X)?gridXi:GRID_SIZE_X;
m_gridY=(gridYi>0&&gridXi<GRID_MAX_Y)?gridYi:GRID_SIZE_Y;
// the height inlet
m_inletH = inlet_new(this->x_obj, &this->x_obj->ob_pd, &s_float, gensym("Ht"));
......
......@@ -30,8 +30,10 @@ rubber :: rubber( t_floatarg gridX, t_floatarg gridY )
: GemShape(1.0), m_height(0.0), m_speed(0), m_grab(-1),
m_alreadyInit(0), m_springKS(0.3), m_drag(0.5), m_mass(NULL), m_spring(NULL)
{
m_grid_sizeX = (gridX>0.)?(int)gridX:GRID_SIZE_X;
m_grid_sizeY = (gridY>0.)?(int)gridY:GRID_SIZE_Y;
int gridXi=static_cast<int>(gridX);
int gridYi=static_cast<int>(gridY);
m_grid_sizeX = (gridXi>0)?gridXi:GRID_SIZE_X;
m_grid_sizeY = (gridYi>0)?gridYi:GRID_SIZE_Y;
// the height inlet
m_inletH = inlet_new(this->x_obj, &this->x_obj->ob_pd, &s_float, gensym("Ht"));
......
......@@ -408,13 +408,15 @@ void sphere3d :: setCartMessCallback(void *data,
t_floatarg i, t_floatarg j,
t_floatarg x, t_floatarg y, t_floatarg z)
{
GetMyClass(data)->setCartesian((int)i, (int)j, x, y, z);
GetMyClass(data)->setCartesian(static_cast<int>(i), static_cast<int>(j),
x, y, z);
}
void sphere3d :: setSphMessCallback(void *data,
t_floatarg i, t_floatarg j,
t_floatarg r, t_floatarg phi, t_floatarg theta)
{
GetMyClass(data)->setSpherical((int)i, (int)j, r, phi, theta);
GetMyClass(data)->setSpherical(static_cast<int>(i), static_cast<int>(j),
r, phi, theta);
}
void sphere3d :: printMessCallback(void *data)
{
......
......@@ -103,7 +103,7 @@ teapot :: teapot(t_floatarg size, t_floatarg slice)
: GemGluObj(size)
{
m_drawType=GL_FILL;
m_numSlices=(int)slice;
m_numSlices=static_cast<int>(slice);
if(m_numSlices<=0)m_numSlices=14;
m_texCoords[0][0]=0;m_texCoords[0][1]=0;
......
......@@ -67,10 +67,11 @@ FTFont *text2d :: makeFont(const char*fontfile){
/////////////////////////////////////////////////////////
void text2d :: setFontSize(t_float size){
m_fontSize = size;
if (m_font)if (! m_font->FaceSize((int)m_fontSize) ) {
int isize=static_cast<int>(m_fontSize);
if (m_font)if (! m_font->FaceSize(isize) ) {
error("GEMtext: unable set fontsize !");
}
if (m_afont)if (! m_afont->FaceSize((int)m_fontSize) ) {
if (m_afont)if (! m_afont->FaceSize(isize) ) {
error("GEMtext: unable set fontsize !");
}
setModified();
......@@ -183,5 +184,5 @@ void text2d :: aliasMess(int io)
}
void text2d :: aliasMessCallback(void *data, t_floatarg io)
{
GetMyClass(data)->aliasMess((int)io);
GetMyClass(data)->aliasMess(static_cast<int>(io));
}
......@@ -57,7 +57,7 @@ void textextruded :: setDepth(float prec)
{
m_fontDepth = prec;
if(!m_font)return;
m_font->Depth((int)m_fontDepth);
m_font->Depth(m_fontDepth);
setFontSize();
setModified();
}
......
......@@ -42,12 +42,12 @@ torus :: torus(int argc, t_atom *argv)
switch(argc){
case 3:
size = atom_getfloat(&argv[0]);
numSlices = (int)atom_getfloat(&argv[1]);
numSlices = atom_getint(&argv[1]);
m_innerRadius = atom_getfloat(&argv[2]);
break;
case 2:
size = atom_getfloat(&argv[0]);
numSlices = (int)atom_getfloat(&argv[1]);
numSlices = atom_getint(&argv[1]);
break;
case 1:
size = atom_getfloat(&argv[0]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment