int SceneEstimatorTrackedCluster::GetTotalSize() { return GetFixedSize() + sizeof(SceneEstimatorClusterPartition)*(int)closestPartitions.size() + sizeof(SceneEstimatorClusterPoint)*(int)points.size(); }
void SceneEstimatorTrackedCluster::CopySparse(void* memory, int& byteOffset) { numPoints = (int)points.size (); numClosestPartitions = (int)closestPartitions.size(); //copy the beginning.... memcpy (((unsigned char*)(memory))+byteOffset,this,GetFixedSize()); byteOffset+=GetFixedSize(); //and the vectors.... //partitions if (closestPartitions.size() > 0) { memcpy (((unsigned char*)(memory))+byteOffset,&closestPartitions.front(),sizeof(SceneEstimatorClusterPartition)*closestPartitions.size()); byteOffset+=sizeof(SceneEstimatorClusterPartition)*((int)closestPartitions.size()); } //points if (points.size() > 0) { memcpy (((unsigned char*)(memory))+byteOffset,&points.front(),sizeof(SceneEstimatorClusterPoint)*points.size()); byteOffset+=sizeof(SceneEstimatorClusterPoint)*((int)points.size()); } }
bool EFontFT2::IsFixedSize(float size) const { eint32 count = 0; if(size <= 0 || !HasFixedSize(&count) || count <= 0) return false; for(eint32 i = 0; i < count; i++) { float nsize = 0; if(!GetFixedSize(&nsize, i)) continue; if(nsize == size) return true; } return false; }
//include itself INT CDUITreeNode::GetTotalHeight() { if ( !IsVisible() ) return 0; int nTotalHeight = GetFixedSize().cy; if ( IsExpand() && HaveChild() ) { INT nCount = m_arChildControl.size(); for ( int i=0;i<nCount;i++) { HDUITREEITEM hChild = (HDUITREEITEM)m_arChildControl[i]->GetInterface(ITreeViewItemName); if ( hChild ) nTotalHeight += hChild->GetTotalHeight(); } } return nTotalHeight; }
BOOL CDUIProgressBarBase::EstimateSize(SIZE sizeAvaiable, SIZE& sizeRet) { CRefPtr<CImageList> image = m_uiData.m_imageBK; if(!image.IsNull() && !image->IsNull()) { sizeRet.cx = image->GetIconWidth(); sizeRet.cy = image->GetIconHeight(); } sizeRet.cx += (m_rtMargin.left + m_rtMargin.right); sizeRet.cy += (m_rtMargin.top + m_rtMargin.bottom); SIZE sizeFixed = GetFixedSize(); if(sizeFixed.cx != 0) { sizeRet.cx = sizeFixed.cx; } if(sizeFixed.cy != 0) { sizeRet.cy = sizeFixed.cy; } return TRUE; }