本文整理汇总了C++中SetGeometry函数的典型用法代码示例。如果您正苦于以下问题:C++ SetGeometry函数的具体用法?C++ SetGeometry怎么用?C++ SetGeometry使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetGeometry函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetGeometry
//------------------------------------------------------------------------
void CGunTurret::ReadProperties(IScriptTable *pProperties)
{
CItem::ReadProperties(pProperties);
if(pProperties)
{
m_turretparams.Reset(pProperties);
const char *model=0;
if(GetEntityProperty("objBase", model) && model && *model)
{
SetGeometry(eIGS_Aux0, model);
}
if(GetEntityProperty("objModel", model) && model && *model)
{
SetGeometry(eIGS_ThirdPerson, model);
}
if(GetEntityProperty("objBarrel", model) && model && *model)
{
SetGeometry(eIGS_Aux1, model);
}
if(GetEntityProperty("objDestroyed", model) && model && *model)
SetGeometry(eIGS_Destroyed, model);
}
}
示例2: SetGeometry
int swDesktop::Init()
{
swMain* Main = swMain::Instance();
if(!Main){
Debug << " No main instance ??";DEND;
return -1;
}
// Just a test!!
(*Main) += sigc::mem_fun(this, &swDesktop::_CanExit);
// ----------------------------------------------------
swNCurses* _n = Main->CursesInstance();
if(! _n ) {
Debug << " No Curses instance ??";DEND;
return -1;
}
SetGeometry( Rect(0,0, _n->Width(), _n->Height()) );
_wr->Clear();
_wr->Fill( Rect(0,0, _n->Width(), _n->Height()), swTAttr(7, 0, A_BOLD), ACS_CKBOARD);
// ------------------------------------------------- TESTS
swLabel* label = new swLabel(this,0,"desk label test");
label->SetGeometry( Rect( 0,0, Width(), 1));
String S;
S << "<fgcolor yellow; strong;>Label</strong; fgcolor white;> test in desktop: my W=" << Width() << ": my H=" << Height();
(*label)<< S;
Update();
return 0;
}
示例3: SetGeometry
int swDesktop::Init()
{
swMain* Main = swMain::Instance();
if(!Main){
Debug << " No main instance ??";DEND;
return -1;
}
// Just a test!!
(*Main) += sigc::mem_fun(this, &swDesktop::_CanExit);
// ----------------------------------------------------
swNCurses* _n = Main->CursesInstance();
if(! _n ) {
Debug << " No Curses instance ??";DEND;
return -1;
}
SetGeometry( Rect(0,0, _n->Width(), _n->Height()) );
_wr->Clear();
//
swText T;
T << " <fgcolor red;bgcolor white; /strong;> Desktop initializecd...<fgcolor black;>Good To GO!!! <fgcolor blue;> Actual size: <fgcolor black;>"
<< Width() << "<fgcolor blue;>:<fgcolor black;>" << Height() << " ";
T << swText::END;
PStr p = T.Data();
mvaddchstr( 0, 3, p);// Height()-2, p );
delete [] p;
T.ReleaseData();
Update();
return 0;
}
示例4: SetEntityProperty
//------------------------------------------------------------------------
void CAmmoPickup::PostInit( IGameObject * pGameObject )
{
// fix for hud displaying the wrong ammo name
if (!m_ammoName.empty())
{
SetEntityProperty("AmmoName", m_ammoName.c_str());
SetEntityProperty("Count", m_ammoCount);
}
else
{
const char *ammoName=0;
if (GetEntityProperty("AmmoName", ammoName) && ammoName && ammoName[0])
{
m_ammoName=ammoName;
GetEntityProperty("Count", m_ammoCount);
}
}
if (m_modelName.empty())
{
const char *model=0;
if (GetEntityProperty("objModel", model) && model && model[0])
m_modelName=model;
}
if (!m_modelName.empty())
SetGeometry(eIGS_ThirdPerson, m_modelName.c_str());
CWeapon::PostInit(pGameObject);
}
示例5: ParsePageGeometry
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% P a r s e P a g e G e o m e t r y %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% ParsePageGeometry() returns a region as defined by the geometry string with
% respect to the image dimensions.
%
% The format of the ParsePageGeometry method is:
%
% MagickStatusType ParsePageGeometry(const Image *image,
% const char *geometry,RectangeInfo *region_info,
% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
% o geometry: The geometry (e.g. 100x100+10+10).
%
% o region_info: the region as defined by the geometry string with
% respect to the image and its gravity.
%
% o exception: return any errors or warnings in this structure.
%
*/
MagickExport MagickStatusType ParsePageGeometry(const Image *image,
const char *geometry,RectangleInfo *region_info,ExceptionInfo *exception)
{
MagickStatusType
flags;
SetGeometry(image,region_info);
if (image->page.width != 0)
region_info->width=image->page.width;
if (image->page.height != 0)
region_info->height=image->page.height;
flags=ParseAbsoluteGeometry(geometry,region_info);
if (flags == NoValue)
{
(void) ThrowMagickException(exception,GetMagickModule(),OptionError,
"InvalidGeometry","`%s'",geometry);
return(flags);
}
if ((flags & PercentValue) != 0)
{
region_info->width=image->columns;
region_info->height=image->rows;
}
flags=ParseMetaGeometry(geometry,®ion_info->x,®ion_info->y,
®ion_info->width,®ion_info->height);
return(flags);
}
示例6: geometry
/*!
\brief Load geometry (linestring HP/DPM layer)
\todo Really needed?
\return TRUE on success or FALSE on failure
*/
bool VFKFeature::LoadGeometryLineStringHP()
{
int id, idxId, idxHp_Id;
VFKDataBlock *poDataBlockLines;
VFKFeature *poLine;
poDataBlockLines = (VFKDataBlock *) m_poDataBlock->GetReader()->GetDataBlock("SBP");
if (!poDataBlockLines)
return FALSE;
idxId = m_poDataBlock->GetPropertyIndex("ID");
idxHp_Id = poDataBlockLines->GetPropertyIndex("HP_ID");
if (idxId < 0 || idxHp_Id < 0)
return FALSE;
id = GetProperty(idxId)->GetValueI();
poLine = poDataBlockLines->GetFeature(idxHp_Id, id);
if (!poLine || !poLine->GetGeometry())
return FALSE;
SetGeometry(poLine->GetGeometry());
poDataBlockLines->ResetReading();
return TRUE;
}
示例7: SetVerticalPolicy
EBox::EBox(float x, float y, float w,float h, float marginL, float marginR, float marginU, float marginD) {
_nIterIndice = 0;
_minInnerWidth = 0;
_minInnerHeight = 0;
_lpParent = NULL;
_fMaxBlend = 1;
_fBlend = 1;
_x = 0;
_y = 0;
_nNumMaximizeChild = 0;
SetVerticalPolicy(VCENTER);
SetHorisontalPolicy(HCENTER);
SetSizePolicy(INHERIT);
SetCentered(false);
SetGeometry(x,y,w,h);
SetMargin(marginL,marginR,marginU,marginD);
_layoutType = VERTICAL;
if (bg == NULL)
bg = KPTK::createKGraphic();
refCount++;
}
示例8: NewPixelRegionIterator
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% N e w P i x e l R e g i o n I t e r a t o r %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% NewPixelRegionIterator() returns a new pixel iterator.
%
% The format of the NewPixelRegionIterator method is:
%
% PixelIterator *NewPixelRegionIterator(MagickWand *wand,const ssize_t x,
% const ssize_t y,const size_t width,const size_t height)
%
% A description of each parameter follows:
%
% o wand: the magick wand.
%
% o x,y,columns,rows: These values define the perimeter of a region of
% pixels.
%
*/
WandExport PixelIterator *NewPixelRegionIterator(MagickWand *wand,
const ssize_t x,const ssize_t y,const size_t width,const size_t height)
{
CacheView
*view;
const char
*quantum;
ExceptionInfo
*exception;
Image
*image;
PixelIterator
*iterator;
size_t
depth;
assert(wand != (MagickWand *) NULL);
depth=MAGICKCORE_QUANTUM_DEPTH;
quantum=GetMagickQuantumDepth(&depth);
if (depth != MAGICKCORE_QUANTUM_DEPTH)
ThrowWandFatalException(WandError,"QuantumDepthMismatch",quantum);
if ((width == 0) || (width == 0))
ThrowWandFatalException(WandError,"ZeroRegionSize",quantum);
image=GetImageFromMagickWand(wand);
if (image == (Image *) NULL)
return((PixelIterator *) NULL);
exception=AcquireExceptionInfo();
view=AcquireVirtualCacheView(image,exception);
if (view == (CacheView *) NULL)
return((PixelIterator *) NULL);
iterator=(PixelIterator *) AcquireMagickMemory(sizeof(*iterator));
if (iterator == (PixelIterator *) NULL)
ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
wand->name);
(void) ResetMagickMemory(iterator,0,sizeof(*iterator));
iterator->id=AcquireWandId();
(void) FormatLocaleString(iterator->name,MaxTextExtent,"%s-%.20g",
PixelIteratorId,(double) iterator->id);
iterator->exception=exception;
iterator->view=view;
SetGeometry(image,&iterator->region);
iterator->region.width=width;
iterator->region.height=height;
iterator->region.x=x;
iterator->region.y=y;
iterator->pixel_wands=NewPixelWands(iterator->region.width);
iterator->y=0;
iterator->debug=IsEventLogging();
if (iterator->debug != MagickFalse)
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",iterator->name);
iterator->signature=WandSignature;
return(iterator);
}
示例9: ImageList_composite_layers
/*
Method: ImageList#composite_layers
Purpose: Equivalent to convert's -layers composite option
Notes: see mogrify.c
*/
VALUE
ImageList_composite_layers(int argc, VALUE *argv, VALUE self)
{
#if defined(HAVE_COMPOSITELAYERS)
volatile VALUE source_images;
Image *dest, *source, *new_images;
RectangleInfo geometry;
CompositeOperator operator = OverCompositeOp;
ExceptionInfo exception;
switch (argc)
{
case 2:
VALUE_TO_ENUM(argv[1], operator, CompositeOperator);
case 1:
source_images = argv[0];
break;
default:
rb_raise(rb_eArgError, "wrong number of arguments (expected 1 or 2, got %d)", argc);
break;
}
// Convert ImageLists to image sequences.
dest = images_from_imagelist(self);
new_images = clone_imagelist(dest);
rm_split(dest);
source = images_from_imagelist(source_images);
SetGeometry(new_images,&geometry);
(void) ParseAbsoluteGeometry(new_images->geometry, &geometry);
geometry.width = source->page.width != 0 ? source->page.width : source->columns;
geometry.height = source->page.height != 0 ? source->page.height : source->rows;
GravityAdjustGeometry(new_images->page.width != 0 ? new_images->page.width : new_images->columns
, new_images->page.height != 0 ? new_images->page.height : new_images->rows
, new_images->gravity, &geometry);
GetExceptionInfo(&exception);
CompositeLayers(new_images, operator, source, geometry.x, geometry.y, &exception);
rm_split(source);
rm_check_exception(&exception, new_images, DestroyOnError);
(void) DestroyExceptionInfo(&exception);
return rm_imagelist_from_images(new_images);
#else
self = self;
argc = argc;
argv = argv;
rm_not_implemented();
return (VALUE)0;
#endif
}
示例10: NewPixelRegionIterator
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% N e w P i x e l R e g i o n I t e r a t o r %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% NewPixelRegionIterator() returns a new pixel iterator.
%
% The format of the NewPixelRegionIterator method is:
%
% PixelIterator NewPixelRegionIterator(MagickWand *wand,const long x,
% const long y,const unsigned long columns,const unsigned long rows,
% const MagickBooleanType modify)
%
% A description of each parameter follows:
%
% o wand: the magick wand.
%
% o x,y,columns,rows: These values define the perimeter of a region of
% pixels.
%
*/
WandExport PixelIterator *NewPixelRegionIterator(MagickWand *wand,const long x,
const long y,const unsigned long columns,const unsigned long rows)
{
const char
*quantum;
Image
*image;
PixelIterator
*iterator;
unsigned long
depth;
ViewInfo
*view;
assert(wand != (MagickWand *) NULL);
depth=MAGICKCORE_QUANTUM_DEPTH;
quantum=GetMagickQuantumDepth(&depth);
if (depth != MAGICKCORE_QUANTUM_DEPTH)
ThrowWandFatalException(WandError,"QuantumDepthMismatch",quantum);
if ((columns == 0) || (rows == 0))
ThrowWandFatalException(WandError,"ZeroRegionSize",quantum);
image=GetImageFromMagickWand(wand);
if (image == (Image *) NULL)
return((PixelIterator *) NULL);
view=OpenCacheView(image);
if (view == (ViewInfo *) NULL)
return((PixelIterator *) NULL);
iterator=(PixelIterator *) AcquireMagickMemory(sizeof(*iterator));
if (iterator == (PixelIterator *) NULL)
ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
wand->name);
(void) ResetMagickMemory(iterator,0,sizeof(*iterator));
iterator->id=AcquireWandId();
(void) FormatMagickString(iterator->name,MaxTextExtent,"%s-%lu",
PixelIteratorId,iterator->id);
iterator->exception=AcquireExceptionInfo();
iterator->view=view;
SetGeometry(image,&iterator->region);
iterator->region.width=columns;
iterator->region.height=rows;
iterator->region.x=x;
iterator->region.y=y;
iterator->pixel_wands=NewPixelWands(iterator->region.width);
iterator->y=0;
iterator->debug=IsEventLogging();
if (iterator->debug != MagickFalse)
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",iterator->name);
iterator->signature=WandSignature;
return(iterator);
}
示例11: LatticeFrame
FrameModifier::FrameModifier (LatticeFrame* frame, const std::string& label)
: LatticeFrame(label),subFrame(frame)
{
LatticeFrame* oldSuperFrame = frame->SetSuperFrame(this);
if(oldSuperFrame)
{
oldSuperFrame->ReplaceSubFrame(frame,this);
}
SetGeometry(frame->GetGeometry());
}
示例12: SetWindowLong
Window::Window(HWND hwnd) {
SetWindowLong(hwnd, GWL_USERDATA, (LONG)this);
oldProc_ = (WNDPROC)SetWindowLong(hwnd, GWL_WNDPROC, (LONG)Proc);
hwnd_ = hwnd;
TexturePool::GetInstance()->Init(this);
SetHitRegionMode(HitRegionMode::kEntirely);
RECT rect;
GetClientRect(hwnd, &rect);
SetGeometry(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top);
}
示例13: FUNCTION_PROFILER
//------------------------------------------------------------------------
bool CItem::SetGeometryFromParams(int slot, const IItemParamsNode *geometry)
{
FUNCTION_PROFILER(GetISystem(), PROFILE_GAME);
const char *name = geometry->GetAttribute("name");
if(!name || !name[0])
{
GameWarning("Missing geometry name for loading item '%s'!", GetEntity()->GetName());
return false;
}
Vec3 position(0,0,0);
geometry->GetAttribute("position", position);
Ang3 angles(0,0,0);
geometry->GetAttribute("angles", angles);
float scale=1.0f;
geometry->GetAttribute("scale", scale);
if(slot == eIGS_FirstPerson)
{
const char *hand = geometry->GetAttribute("hand");
int idx = 0;
if(hand && hand[0])
{
if(!stricmp(hand, "right"))
idx = 1;
else if(!stricmp(hand, "left"))
idx = 2;
else
{
GameWarning("Invalid hand '%s' loading item '%s'!", hand, GetEntity()->GetName());
return false;
}
}
m_fpgeometry[idx].name=name;
m_fpgeometry[idx].position=position;
m_fpgeometry[idx].angles=DEG2RAD(angles);
m_fpgeometry[idx].scale=scale;
// marcio: first person geometry will be loaded upon selecting the weapon in first person
//if (((idx<2) && (m_stats.hand == eIH_Right)) || ((idx==2) && (m_stats.hand == eIH_Left)))
// SetGeometry(slot, name, position, DEG2RAD(angles), scale, false);
}
else
SetGeometry(slot, name, position, DEG2RAD(angles), scale, false);
return true;
}
示例14: QPixmap
void CWidget::resizeEvent(QResizeEvent * event){/*
if (iPixmap) delete iPixmap;
iPixmap = new QPixmap(event->size().width(),event->size().height());
setPixmap(*iPixmap);
if (CWorkspaceManager::GetInstance()) CWorkspaceManager::GetInstance()->GetActiveWorkspace()->resizeEvent(QSize(event->size().width()*4/5,event->size().height()*4/5));
*//*
QPointF imageExplorerPos(this->width()*4/5,0);
QPointF imageExplorerSize(this->width()*1/5,this->height()*4/5);
paint();
*/
SetGeometry(0,0,event->size().width(),event->size().height());
}
示例15: NewPixelIterator
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
% %
% N e w P i x e l I t e r a t o r %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% NewPixelIterator() returns a new pixel iterator.
%
% The format of the NewPixelIterator method is:
%
% PixelIterator *NewPixelIterator(MagickWand *wand)
%
% A description of each parameter follows:
%
% o wand: the magick wand.
%
*/
WandExport PixelIterator *NewPixelIterator(MagickWand *wand)
{
const char
*quantum;
Image
*image;
PixelIterator
*iterator;
size_t
depth;
CacheView
*view;
depth=MAGICKCORE_QUANTUM_DEPTH;
quantum=GetMagickQuantumDepth(&depth);
if (depth != MAGICKCORE_QUANTUM_DEPTH)
ThrowWandFatalException(WandError,"QuantumDepthMismatch",quantum);
assert(wand != (MagickWand *) NULL);
image=GetImageFromMagickWand(wand);
if (image == (Image *) NULL)
return((PixelIterator *) NULL);
view=AcquireCacheView(image);
if (view == (CacheView *) NULL)
return((PixelIterator *) NULL);
iterator=(PixelIterator *) AcquireMagickMemory(sizeof(*iterator));
if (iterator == (PixelIterator *) NULL)
ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed",
GetExceptionMessage(errno));
(void) ResetMagickMemory(iterator,0,sizeof(*iterator));
iterator->id=AcquireWandId();
(void) FormatMagickString(iterator->name,MaxTextExtent,"%s-%.20g",
PixelIteratorId,(double) iterator->id);
iterator->exception=AcquireExceptionInfo();
iterator->view=view;
SetGeometry(image,&iterator->region);
iterator->region.width=image->columns;
iterator->region.height=image->rows;
iterator->region.x=0;
iterator->region.y=0;
iterator->pixel_wands=NewPixelWands(iterator->region.width);
iterator->y=0;
iterator->debug=IsEventLogging();
if (iterator->debug != MagickFalse)
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",iterator->name);
iterator->signature=WandSignature;
return(iterator);
}