当前位置: 首页>>代码示例>>C++>>正文


C++ SetDimensions函数代码示例

本文整理汇总了C++中SetDimensions函数的典型用法代码示例。如果您正苦于以下问题:C++ SetDimensions函数的具体用法?C++ SetDimensions怎么用?C++ SetDimensions使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了SetDimensions函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: StaticInit

//======================================================================
//======================================================================
NvUIGraphic::NvUIGraphic(NvUITexture *uiTex, float dstw/*==0*/, float dsth/*==0*/)
{
    StaticInit();
    PrivateInit();
    m_tex = uiTex;
    m_tex->AddRef();
    if (dstw!=0)
        SetDimensions(dstw, dsth);
    else
        SetDimensions((float)m_tex->GetWidth(), (float)m_tex->GetHeight());
}
开发者ID:Ninglin,项目名称:OpenGLSamples,代码行数:13,代码来源:NvUIGraphic.cpp

示例2:

vtkSmartPointer<vtkUniformGrid> FlowAnalysis::vtkMakeGrid(){
	auto grid=vtkSmartPointer<vtkUniformGrid>::New();
	Vector3r cellSize3=Vector3r::Constant(cellSize);
	// if data are in cells, we need extra items along each axes, and shift the origin by half-cell down
	if(cellData) {
		grid->SetDimensions((boxCells+Vector3i::Ones()).eval().data());
		Vector3r origin=(box.min()-.5*cellSize3);
		grid->SetOrigin(origin.data());
	} else {
		grid->SetDimensions(boxCells.data());
		grid->SetOrigin(box.min().data());
	}
	grid->SetSpacing(cellSize,cellSize,cellSize);
	return grid;
}
开发者ID:CrazyHeex,项目名称:woo,代码行数:15,代码来源:FlowAnalysis.cpp

示例3: next

void KVASGroup::SetDimensions()
{
   //Set dimensions of group according to dimensions of all its telescopes.
   KVTelescope* tel, *tel1;
   TIter next(GetTelescopes());
   tel = (KVTelescope*) next();
   if (!tel)
      return;
   tel1 = (KVTelescope*) next();
   if (!tel1)
      return;
   SetDimensions(tel, tel1);
   while ((tel = (KVTelescope*) next())) {
      SetDimensions(this, tel);
   }
}
开发者ID:GiuseppePast,项目名称:kaliveda,代码行数:16,代码来源:KVASGroup.cpp

示例4: ArpASSERT

status_t SeqManageRosterWindow::SetConfiguration(const BMessage* config)
{
	ArpASSERT(config);
	status_t	err = SetDimensions(config, this);
	if (err != B_OK) return err;
	/* Set the columns
	 */
	BColumnListView* table = dynamic_cast<BColumnListView*>( FindView(TABLE_STR) );
	if (table) {
		BMessage	colMsg;
		for (int32 k = 0; config->FindMessage("column", k, &colMsg) == B_OK; k++) {
			const char*		colName;
			float			colW;
			bool			colVis;
			if (colMsg.FindString("name", &colName) == B_OK
					&& colMsg.FindFloat("width", &colW) == B_OK
					&& colMsg.FindBool("visible", &colVis) == B_OK) {
				BColumn*	col = col_named(colName, table);
				if (col) {
					col->SetWidth(colW);
					col->SetVisible(colVis);
				}
			}
		}
	}
	return B_OK;
}
开发者ID:tgkokk,项目名称:Sequitur,代码行数:27,代码来源:SeqManageRosterWindows.cpp

示例5: MinDimensions

template <typename T> void ListWidget<T>::UpdateDimensions()
{
	Vector2n Dimensions;

	for (auto & Entry : m_List)
	{
		Dimensions.X() = std::max<sint32>(Dimensions.X(), Concept::GetDimensions(Entry).X());
		Dimensions.Y() += Concept::GetDimensions(Entry).Y();
	}

	// TEST
	if (!m_TypingModule.GetString().empty())
	{
		for (auto & Pointer : GetGestureRecognizer().GetConnected())
		{
			if (Pointer::VirtualCategory::POINTING == Pointer->GetVirtualCategory())
			{
				Dimensions.X() = std::max<sint32>(Dimensions.X(), static_cast<sint32>(m_TypingModule.GetString().length() * charWidth));
				Dimensions.Y() += 1 * lineHeight;
				break;
			}
		}
	}

	Vector2n MinDimensions(3 * charWidth, lineHeight);
	Dimensions.X() = std::max<sint32>(Dimensions.X(), MinDimensions.X());
	Dimensions.Y() = std::max<sint32>(Dimensions.Y(), MinDimensions.Y());

	SetDimensions(Dimensions);
}
开发者ID:prinsmike,项目名称:Conception,代码行数:30,代码来源:ListWidget.hpp

示例6: FindThread

/*M+M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M+++M
  Method:   COBall::CImpIBall::Reset

  Summary:  The Reset member method of the IBall interface implementation.
            Called by outside clients of a COBall object to reset the
            virtual ball. It is restored to the upper left corner.

  Args:     RECT* pNewRect,
              Pointer to a RECT structure. Tells the COBall the bounding
              rectangle within which the ball can move.
            short nBallSize,
              The size of the ball in pixels. nBallSize == Width == Height
              meaning that a circle is assumed.

  Modifies: ...

  Returns:  void
M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M---M-M*/
STDMETHODIMP COBall::CImpIBall::Reset(
               RECT* pNewRect,
               short nBallSize)
{
  HRESULT hr = E_FAIL;
  int nDim, xDirection, yDirection;

  if (OwnThis())
  {
    // Find the thread who is executing this and remember its color.
    FindThread();

    m_xSkew = m_ySkew = BALL_MOVE_SKEW;
    m_WinRect.left = pNewRect->left;
    m_WinRect.top = pNewRect->top;
    m_WinRect.right = pNewRect->right;
    m_WinRect.bottom = pNewRect->bottom;
    nDim = nBallSize ? nBallSize : max(5, m_WinRect.right / 13);
    SetDimensions(nDim, nDim);
    SetPosition(0, 0);
    xDirection = ((lRandom() % m_xSkew) + m_xSkew);
    yDirection = ((lRandom() % m_ySkew) + m_ySkew);
    SetDirection(xDirection, yDirection);

    hr = NOERROR;

    UnOwnThis();
  }

  return hr;
}
开发者ID:Jinjiego,项目名称:VCSamples,代码行数:49,代码来源:ball.cpp

示例7: ArpASSERT

status_t SeqPhrasePropertyWindow::SetConfiguration(const BMessage* config)
{
	ArpASSERT(config);
	status_t	err = SetDimensions(config, this);
	if (err != B_OK) return err;
	return B_OK;
}
开发者ID:tgkokk,项目名称:Sequitur,代码行数:7,代码来源:SeqPhrasePropertyWindow.cpp

示例8: GetBoundingRect

void ListedTextItems::ClearEntries()
{
    Rect oldrect = GetBoundingRect();
    _items.Clear();
    OnItemsClear();
    SetDimensions( GetWidth(), GetH() );
}
开发者ID:BackupTheBerlios,项目名称:utgs-svn,代码行数:7,代码来源:ListedTextItems.cpp

示例9: SetDimensions

dgSphere::dgSphere (const dgQuaternion &quat, const dgVector &position, const dgVector& dim)
	:dgMatrix(quat, position)
{
   SetDimensions (dim.m_x, dim.m_y, dim.m_z);
   HACD_ASSERT (0);
//	planeTest = FrontTest;
}
开发者ID:Reticulatas,项目名称:MochaEngineFinal,代码行数:7,代码来源:dgSphere.cpp

示例10: SetDimensions

//PLAYER CONSTRUCTOR///////////////////////////////////////////////////////////////////////////////////////////////////////
Player::Player(void)
{
	m_x = 0; //positions player at provided parameters
	m_y = 0;

	SetDimensions(16, 16);
	
	SetVelocity(2.0f, 2.0f); //sets the velocity for the player

	Star.MoveTo(-10, -10);
	Star.SetDimensions(6, 6);
	Star.SetVelocity(0, 0);
	
	throw_time = 0; //ready to throw a throwing star
	health = 750; //starts at full health
	key = false; //does not begin with a key
	dead = false; //defaults to alive

	LoadBitMapsandMasks(); //load all the bitmaps and masks for the player animations

	bitmap = animations[0]; //set display bitmap to first bitmap of animation

	clr = 0; //clr variable defaulted to 0 - points to green eyed animations
	steps = 1; 

	bitmask = masks[0]; //set display mask to first mask
	
	Initialise();	
} 
开发者ID:NoSilentWonder,项目名称:Stealth,代码行数:30,代码来源:player.cpp

示例11: SetDimensions

bool
Simbox::setArea(const NRLib::Volume * volume, int nx, int ny, std::string & errText, bool scale)
{
  double scale_value = 1.0;

  if (scale == true) //SGRI
    scale_value = 1000;

  double x0  = volume->GetXMin()*scale_value;
  double y0  = volume->GetYMin()*scale_value;
  double lx  = volume->GetLX()*scale_value;
  double ly  = volume->GetLY()*scale_value;
  double rot = volume->GetAngle();
  double dx  = lx/static_cast<double>(nx);
  double dy  = ly/static_cast<double>(ny);

  try
  {
    SetDimensions(x0,y0,lx,ly);
  }
  catch (NRLib::Exception & e)
  {
    errText += "Could not set x0, y0, lx, and ly.\n";
    errText += e.what();
    return true; // Failed
  }
  try
  {
    SetAngle(rot);
  }
  catch (NRLib::Exception & e)
  {
    errText += "Could not set rotation angle.\n";
    errText += e.what();
    return true; // Failed
  }
  cosrot_      = cos(rot);
  sinrot_      = sin(rot);
  dx_          = dx;
  dy_          = dy;
  nx_          = static_cast<int>(0.5+lx/dx_);
  ny_          = static_cast<int>(0.5+ly/dy_);

  // In case IL/XL information is not available, we fall back
  //  on the following base case values ...
  inLine0_     = -0.5;
  crossLine0_  = -0.5;
  ilStepX_     =  cosrot_/dx_;
  ilStepY_     =  sinrot_/dx_;
  xlStepX_     = -sinrot_/dy_;
  xlStepY_     =  cosrot_/dy_;

  if(status_ == EMPTY)
    status_ = NODEPTH;
  else if(status_ == NOAREA)
    status_ = BOXOK;

  return false; // OK
}
开发者ID:CRAVA,项目名称:crava,代码行数:59,代码来源:simbox.cpp

示例12: scaleVector

void dgSphere::SetDimensions(const dgFloat32 vertex[], dgInt32 strideInBytes,
    const dgInt32 triangles[], dgInt32 indexCount, const dgMatrix *basis)
{
  dgVector eigen;
  dgVector scaleVector(dgFloat32(1.0f), dgFloat32(1.0f), dgFloat32(1.0f),
      dgFloat32(0.0f));

  if (indexCount < 3)
  {
    return;
  }

  dgInt32 stride = dgInt32(strideInBytes / sizeof(dgFloat32));
  if (!basis)
  {

    InternalSphere::Statistics(*this, eigen, scaleVector, vertex, triangles,
        indexCount, stride);

    dgInt32 k = 0;
    for (dgInt32 i = 0; i < 3; i++)
    {
      if (k >= 6)
      {
        break;
      }
      for (dgInt32 j = i + 1; j < 3; j++)
      {
        dgFloat32 aspect = InternalSphere::AspectRatio(eigen[i], eigen[j]);
        if (aspect > dgFloat32(0.9f))
        {
          scaleVector[i] *= dgFloat32(2.0f);
          InternalSphere::Statistics(*this, eigen, scaleVector, vertex,
              triangles, indexCount, stride);
          k++;
          i = -1;
          break;
        }
      }
    }
  }
  else
  {
    *this = *basis;
  }

  dgVector min;
  dgVector max;
  InternalSphere::BoundingBox(*this, vertex, stride, triangles, indexCount, min,
      max);

  dgVector massCenter(max + min);
  massCenter = massCenter.Scale(dgFloat32(0.5f));
  m_posit = TransformVector(massCenter);

  dgVector dim(max - min);
  dim = dim.Scale(dgFloat32(0.5f));
  SetDimensions(dim.m_x, dim.m_y, dim.m_z);
}
开发者ID:Evil-Spirit,项目名称:Nutmeg,代码行数:59,代码来源:dgSphere.cpp

示例13: SetPosition

// ============================================================================
// ============================================================================
bool Vista2DRectangle::Init( float fPosX, float fPosY, float fWidth, float fHeight, unsigned char nRed, unsigned char nGreen, unsigned char nBlue)
{
	bool success = SetPosition( fPosX, fPosY );
	success &= SetDimensions( fWidth, fHeight );
	success &= SetColor( nRed, nGreen, nBlue );
	m_bIsInitialized = success;
	return success;
}
开发者ID:HBPVIS,项目名称:Vista,代码行数:10,代码来源:Vista2DDrawingObjects.cpp

示例14: SetDimensions

void OgreSprite::SetScale(double x, double y)
{
   m_scalex = (Ogre::Real)x;
   m_scaley = (Ogre::Real)y;

   SetDimensions(m_width, m_height);
   //m_overlay->setScale(x, y);
}
开发者ID:akadjoker,项目名称:gmogre3d,代码行数:8,代码来源:OgreSprite.cpp

示例15: XawScrollbarResize

static void
XawScrollbarResize(Widget gw)
{
    /* ForgetGravity has taken care of background, but thumb may
     * have to move as a result of the new size. */
    SetDimensions((ScrollbarWidget)gw);
    XawScrollbarRedisplay(gw, NULL, NULL);
}
开发者ID:freedesktop-unofficial-mirror,项目名称:xorg__lib__libXaw,代码行数:8,代码来源:Scrollbar.c


注:本文中的SetDimensions函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。