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


C++ setDimensions函数代码示例

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


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

示例1: setImage

void CTerrain::Initialize()
{
	listter.push_back(this);
	nangle = 0;
	setImage("item", type);
	density = true;
	if(_img != NULL)	setDimensions(_img->w, _img->h);
	else				setDimensions(0, 0);
}
开发者ID:wlue,项目名称:codename_portal,代码行数:9,代码来源:CTerrain.cpp

示例2: MACRO_WIDGET_H

void Widget::addHeight(point_type h) {
    if(_coordMode == CM_ABSOLUTE) setDimensions(
        -1.0f,
        -1.0f,
        -1.0f,
        MACRO_WIDGET_H(_verts()) + h
    );

    else setDimensions(-1.0f, -1.0f, -1.0f, _relCoords[3] + h);
}
开发者ID:BodyViz,项目名称:osg,代码行数:10,代码来源:Widget.cpp

示例3: _verts

void Widget::addOrigin(point_type x, point_type y) {
    if(_coordMode == CM_ABSOLUTE) {
        PointArray* verts = _verts();

        setDimensions(
            MACRO_WIDGET_X(verts) + x,
            MACRO_WIDGET_Y(verts) + y
        );
    }

    else setDimensions(_relCoords[0] + x, _relCoords[1] + y);
}
开发者ID:BodyViz,项目名称:osg,代码行数:12,代码来源:Widget.cpp

示例4: getline

/*!  
 *  Reads meta data of VTU file (grid size, data fields, codex, position of data within file).
 *  Calls setDimension.
 */
void VTKUnstructuredGrid::readMetaData( ){

    std::fstream str;
    std::string line, temp;

    std::fstream::pos_type        position;

    str.open( fh.getPath( ), std::ios::in ) ;

    getline( str, line);
    while( ! bitpit::utils::keywordInString( line, "<VTKFile")){
        getline(str, line);
    };

    if( bitpit::utils::getAfterKeyword( line, "header_type", '\"', temp) ){
        setHeaderType( temp) ;
    };

    while( ! bitpit::utils::keywordInString( line, "<Piece")){
        getline(str, line);
    };

    bitpit::utils::getAfterKeyword( line, "NumberOfPoints", '\"', temp) ;
    bitpit::utils::convertString( temp, nr_points );

    bitpit::utils::getAfterKeyword( line, "NumberOfCells", '\"', temp) ;
    bitpit::utils::convertString( temp, nr_cells );


    position = str.tellg() ;
    readDataHeader( str ) ;


    for( auto &field : geometry ){ 
        str.seekg( position) ;
        if( ! readDataArray( str, *field ) ) {
            std::cout << field->getName() << " DataArray not found" << std::endl ;
        };
    };


    str.close() ;

    if( homogeneousType == VTKElementType::UNDEFINED) {
        setDimensions( nr_cells, nr_points, calcSizeConnectivity() ) ;
    } else {
        setDimensions( nr_cells, nr_points ) ;
    };


    return ;
};
开发者ID:flbernard,项目名称:bitpit,代码行数:56,代码来源:VTKUnstructured.cpp

示例5: getDimensions

void LightEntityItem::setIsSpotlight(bool value) {
    if (value != _isSpotlight) {
        _isSpotlight = value;

        if (_isSpotlight) {
            const float length = getDimensions().z;
            const float width = length * glm::sin(glm::radians(_cutoff));
            setDimensions(glm::vec3(width, width, length));
        } else {
            float maxDimension = glm::max(getDimensions().x, getDimensions().y, getDimensions().z);
            setDimensions(glm::vec3(maxDimension, maxDimension, maxDimension));
        }
    }
}
开发者ID:DaveDubUK,项目名称:hifi,代码行数:14,代码来源:LightEntityItem.cpp

示例6: setDimensions

void Label::setFontDefinition(const FontDefinition& textDefinition)
{
    _systemFont = textDefinition._fontName;
    _systemFontSize = textDefinition._fontSize;
    _hAlignment = textDefinition._alignment;
    _vAlignment = textDefinition._vertAlignment;
    setDimensions(textDefinition._dimensions.width, textDefinition._dimensions.height);
    Color4B textColor = Color4B(textDefinition._fontFillColor);
    textColor.a = textDefinition._fontAlpha;
    setTextColor(textColor);
    
#if (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) && (CC_TARGET_PLATFORM != CC_PLATFORM_IOS)
    if (textDefinition._stroke._strokeEnabled)
    {
        CCLOGERROR("Currently only supported on iOS and Android!");
    }
    _outlineSize = 0.f;
#else
    if (textDefinition._stroke._strokeEnabled && textDefinition._stroke._strokeSize > 0.f)
    {
        Color4B outlineColor = Color4B(textDefinition._stroke._strokeColor);
        outlineColor.a = textDefinition._stroke._strokeAlpha;
        enableOutline(outlineColor, textDefinition._stroke._strokeSize);
    }
#endif

    if (textDefinition._shadow._shadowEnabled)
    {
        enableShadow(Color4B(0, 0, 0, 255 * textDefinition._shadow._shadowOpacity),
            textDefinition._shadow._shadowOffset, textDefinition._shadow._shadowBlur);
    }
}
开发者ID:wade0317,项目名称:Calc,代码行数:32,代码来源:CCLabel.cpp

示例7: setElementType

/*!  
 *  sets the size of the unstructured grid for a homogenous grid.
 *  @param[in]  ncells_     number of cells
 *  @param[in]  npoints_    number of points
 *  @param[in]  type_       typeof element in grid
 */
void VTKUnstructuredGrid::setDimensions( uint64_t ncells_, uint64_t npoints_, VTKElementType type_ ){

    setElementType( type_ );
    setDimensions( ncells_, npoints_ );

    return ;
};
开发者ID:flbernard,项目名称:bitpit,代码行数:13,代码来源:VTKUnstructured.cpp

示例8: assert

// set the identity matrix of dimension n
void Matrix::setIdentityMatrix( int n )		
{
    assert( n > 0 );
    setDimensions( n, n );	
    setZero();
    for ( int i = 0; i < n; i++ ) setElement( i, i, 1.0 );
}
开发者ID:jacobclifford,项目名称:MIBBS,代码行数:8,代码来源:Tools.cpp

示例9: while

void Text::setText(std::string text){
  myText = text;
  int n = 0;
  std::vector<std::string> textLines;
  std::string substring = text;
  while(n != std::string::npos){
    n = substring.find('\n', 0);
      textLines.push_back(substring.substr(0, n));
      substring = substring.substr(n + 1, std::string::npos);
  }
  numLines = textLines.size();
  image.clear();
  for(unsigned int i = 0; i < textLines.size(); i++)
    image.push_back(TTF_RenderText_Blended(font, textLines.at(i).c_str(), color));
  int wtemp, w = 0;
  for(unsigned int i = 0; i < textLines.size(); i++){
    TTF_SizeText(this->font, textLines.at(i).c_str(), &wtemp, NULL);
    if(wtemp > w)
      w = wtemp;
	}
  int h = 10;
  lineSkip = TTF_FontLineSkip(font);
  h = (textLines.size() - 1) * lineSkip + h;
  setDimensions(w, h);
}
开发者ID:BastionFennell,项目名称:BWI-GUI,代码行数:25,代码来源:Text.cpp

示例10: DataReaderException

void CImgLayerRAMLoader::updateRepresentation(std::shared_ptr<DataRepresentation> dest) const {
    auto layerDst = std::static_pointer_cast<LayerRAM>(dest);

    if (layerDisk_->getDimensions() != layerDst->getDimensions()) {
        layerDst->setDimensions(layerDisk_->getDimensions());
    }

    uvec2 dimensions = layerDisk_->getDimensions();
    DataFormatId formatId = DataFormatId::NotSpecialized;

    std::string filePath = layerDisk_->getSourceFile();

    if (!filesystem::fileExists(filePath)) {
        std::string newPath = filesystem::addBasePath(filePath);

        if (filesystem::fileExists(newPath)) {
            filePath = newPath;
        } else {
            throw DataReaderException("Error could not find input file: " + filePath, IvwContext);
        }
    }

    if (dimensions != uvec2(0)) {
        // Load and rescale to input dimensions
        CImgUtils::loadLayerData(layerDst->getData(), filePath, dimensions, formatId, true);
    } else {
        // Load to original dimensions
        CImgUtils::loadLayerData(layerDst->getData(), filePath, dimensions, formatId, false);
        layerDisk_->setDimensions(dimensions);
    }

    layerDisk_->updateDataFormat(DataFormatBase::get(formatId));
}
开发者ID:Ojaswi,项目名称:inviwo,代码行数:33,代码来源:cimglayerreader.cpp

示例11: dimensions_

 Grid::Grid(const IntVector& dimensions)
  : dimensions_(0),
    offsets_(0),
    size_(0)
 {
    setDimensions(dimensions); 
 }
开发者ID:TaherGhasimakbari,项目名称:simpatico,代码行数:7,代码来源:Grid.cpp

示例12: setDimensions

//------------------------------------------------
void guiTypeMultiToggle::setup(string multiToggleName, string xmlNameIn, int defaultBox, vector <string> boxNames){
	bNames = boxNames;
	value.addValue( (int)defaultBox, 0, bNames.size()-1);
	name = multiToggleName;
	xmlName = xmlNameIn;

	float lineHeight = 0;
	for(unsigned int i = 0; i < bNames.size(); i++){
		float lineWidth = boxSpacing + boxSize + displayText.stringWidth(bNames[i]);

		if( lineWidth > hitArea.width ){
			hitArea.width       += lineWidth-hitArea.width;
			boundingBox.width   += lineWidth-hitArea.width;
		}

		lineHeight += displayText.stringHeight(bNames[i]);
	}

	if(lineHeight > hitArea.height){
		hitArea.height      += lineHeight-hitArea.height;
		boundingBox.height  += lineHeight-hitArea.height;
	}

	setDimensions(180, bNames.size()*(guiTypeMultiToggle::boxSize + guiTypeMultiToggle::boxSpacing) + 2);
}
开发者ID:Giladx,项目名称:kinectArmTracker,代码行数:26,代码来源:guiTypeMultiToggle.cpp

示例13: GPUFilter

GPURGB2YUVFilter::GPURGB2YUVFilter(const IntPoint& size)
    : GPUFilter(SHADERID, false, false)
{
    ObjectCounter::get()->incRef(&typeid(*this));

    setDimensions(size);
}
开发者ID:lynxis,项目名称:libavg,代码行数:7,代码来源:GPURGB2YUVFilter.cpp

示例14: setDimensions

bool TextFieldTTF::initWithPlaceHolder(const std::string& placeholder, const Size& dimensions, TextHAlignment alignment, const std::string& fontName, float fontSize)
{
    setDimensions(dimensions.width, dimensions.height);
    setAlignment(alignment, TextVAlignment::CENTER);

    return initWithPlaceHolder(placeholder, fontName, fontSize);
}
开发者ID:jun496276723,项目名称:CocosMFCEditor,代码行数:7,代码来源:CCTextFieldTTF.cpp

示例15: getType

void CButton::Initialize()
{
	image_state = getType();
	setImage("button", image_state);
	UpdateImage();
	setDimensions(_img->w, _img->h);
}
开发者ID:wlue,项目名称:codename_portal,代码行数:7,代码来源:CButton.cpp


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