本文整理汇总了C++中CFrame类的典型用法代码示例。如果您正苦于以下问题:C++ CFrame类的具体用法?C++ CFrame怎么用?C++ CFrame使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CFrame类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: valueChanged
void valueChanged (CControl* pControl)
{
if (pControl->getValue ())
{
switch (pControl->getTag ())
{
case 0:
{
CView* view = desc->createView ("ModalView", this);
if (view)
{
CFrame* frame = pControl->getFrame ();
CPoint center = frame->getViewSize ().getCenter ();
CRect viewSize = view->getViewSize ();
viewSize.offset (center.x - viewSize.getWidth () / 2, center.y - viewSize.getHeight () / 2);
view->setViewSize (viewSize);
view->setMouseableArea (viewSize);
frame->setModalView (view);
view->setAlphaValue (0.f);
view->addAnimation ("AlphaAnimation", new Animation::AlphaValueAnimation (1.f), new Animation::PowerTimingFunction (240, 2));
pControl->setValue (0);
view->forget ();
}
break;
}
case 1:
{
CView* modalView = pControl->getFrame ()->getModalView ();
modalView->addAnimation ("AlphaAnimation", new RemoveModalViewAnimation (0.f), new Animation::PowerTimingFunction (240, 0.5));
pControl->setMouseEnabled (false);
break;
}
}
}
}
示例2: DetectSemgment
void CFrameJSegmentor::DetectSemgment(const CFrame & frame)
{
if( m_RegionMap )
m_RegionMap->Release();
m_SegmentNum = m_SegmentDetector->Segment(*frame.GetImage(), &m_RegionMap);
m_FrameId = frame.Id();
}
示例3:
//////////////////////////////////////////////////////////////
// GetCollisionRect
// - return the entity's bounding rectangle
/*virtual*/ RECT CEntity::GetCollisionRect( void ) const
{
CFrame* currFrame = m_pAM->GetCurrentFrame(m_pAnimInfo);
RECT rCollision = currFrame->GetCollisionRect().GetRECT();
if (m_bFlipped == true)
{
// Get the width of the collision rect before flipping
int width = (rCollision.right - rCollision.left);
// Get the offset from the anchor point to the top left of the collision rect
tVector2D offset = { (float)(rCollision.left), (float)(rCollision.top ) };
// Negate the anchor point x value
rCollision.left = (LONG)(-offset.fX);
rCollision.right = (LONG)(-offset.fX);
// Subtract the width of the collision rect
rCollision.left -= width;
}
// Add the position of the character in the world to the collision rect
rCollision.left += (int)(m_fPosX - m_pGC->GetPosX());
rCollision.right += (int)(m_fPosX - m_pGC->GetPosX());
rCollision.top += (int)(m_fPosY - m_pGC->GetPosY());
rCollision.bottom += (int)(m_fPosY - m_pGC->GetPosY());
return rCollision;
}
示例4: transformToWorldSpace
void Surfel::transformToWorldSpace(const CFrame& xform) {
position = xform.pointToWorldSpace(position);
geometricNormal = xform.vectorToWorldSpace(geometricNormal);
shadingNormal = xform.vectorToWorldSpace(shadingNormal);
shadingTangent1 = xform.vectorToWorldSpace(shadingTangent1);
shadingTangent2 = xform.vectorToWorldSpace(shadingTangent2);
}
示例5: wxInitAllImageHandlers
/*! Application initialization function
*
* This function is called once when the
* application is started. It creates the main frame for
* the program and displays it.
* \returns true
*/
bool CApp::OnInit()
{
wxInitAllImageHandlers();
CFrame *frame = new CFrame();
frame->Show(true);
SetTopWindow(frame);
return true;
}
示例6: close
//-----------------------------------------------------------------------------------
void TutorialEditor::close ()
{
//-- on close we need to delete the frame object.
//-- once again we make sure that the member frame variable is set to zero before we delete it
//-- so that calls to setParameter won't crash.
CFrame* oldFrame = frame;
frame = 0;
oldFrame->forget ();
}
示例7: ShowMapInText
void CPlayerLoop::ShowMapInText(const CFrame &frame)
{
const CMap &map = frame.GetMap();
// печатаем карту
system("clear");
for (int rowNumber = 0; rowNumber < map.GetMapSizeY(); ++rowNumber)
{
for (int colNumber = 0; colNumber < map.GetMapSizeX(); ++colNumber)
{
bool antIsHere = false;
for (size_t antNumber = 0; antNumber < map.GetNumberOfAnts(); ++antNumber)
{
const CAnt &a = map.GetAnt(antNumber);
if((colNumber == a.GetAntPosX()) && (rowNumber == a.GetAntPosY()) && !a.AntIsBanned() && !a.AntIsWinner())
{
std::cout << a.GetAntName()[0];
antIsHere = true;
break;
}
else
{
continue;
}
}
if (!antIsHere)
{
std::cout << (char)map.Cell(colNumber, rowNumber);
}
}
std::cout << std::endl;
}
for (size_t antNumber = 0; antNumber < map.GetNumberOfAnts(); ++antNumber)
{
const CAnt &a = map.GetAnt(antNumber);
if (!a.AntIsBanned() && !a.AntIsWinner())
{
std::cout << "Муравей " << a.GetAntName()
<< " по профессии " << AntTypeToString(a.GetAntType()) << " "
<< AntStatusToString(a.GetAntStatus()) << "!" << std::endl
<< "Находится в клетке X = " << a.GetAntPosX() << " Y = " << a.GetAntPosY()
<< std::endl << std::flush;
}
else
{
std::cout << "Муравей " << a.GetAntName()
<< " по профессии " << AntTypeToString(a.GetAntType()) << " "
<< AntStatusToString(a.GetAntStatus()) << "!" << std::endl;
}
}
std::cout << "Доска объявлений: " << std::endl;
frame.GetBoard().PrintBoard();
std::cout << std::flush;
}
示例8: while
void CGmObjAnim3::CData::Update()
{
unsigned int i = m_oArrFrame.GetSize();
while( i )
{
--i;
CFrame * poFrame = m_oArrFrame[i];
poFrame->Update();
}
}
示例9: while
void CGmObjAnim3::CSharedData::ClearOGL()
{
unsigned int i = m_oArrFrame.GetSize();
while( i )
{
--i;
CFrame * poFrame = m_oArrFrame[i];
poFrame->ClearOGL();
}
}
示例10: CFrame
HRESULT CVideoProcessor::BufferCB(double SampleTime, BYTE *pBuffer, long BufferLen)
{
if (MEDIATYPE_Video == m_mt.majortype)
{
if (MEDIASUBTYPE_YUY2 == m_mt.subtype)
{
//[ Y0 U0 Y1 V0] [ Y2 U1 Y3 V1]
VIDEOINFOHEADER* pVIH=(VIDEOINFOHEADER*)m_mt.pbFormat;
CFrame* pF = new CFrame(
pVIH->bmiHeader.biWidth,
pVIH->bmiHeader.biHeight);
struct YUY2
{
unsigned char y0, u0, y1, v0;
};
//Remember: Macropixel Y0 U0 Y1 V0 = 2 image pixel
for (int j = 0; j < pVIH->bmiHeader.biHeight; j++)
{
YUY2* pRow = (YUY2*)(pBuffer + j*pVIH->bmiHeader.biWidth * 2);
for (int i = 0; i < pVIH->bmiHeader.biWidth / 2; i++)
{
CFrame::PIXEL pixel_1, pixel_2;
//YUY2 to RGB
YUY2* MacroPixel = &pRow[i];
int C = (int)MacroPixel->y0 - 15;
int D = (int)MacroPixel->u0 - 128;
int E = (int)MacroPixel->v0 - 128;
pixel_1.r = max(0,min(255,(298 * C + 409 * E + 128) / 256));
pixel_1.g = max(0, min(255,(298 * C - 100 * D - 208 * E + 128) / 256));
pixel_1.b = max(0, min(255, (298 * C + 516 * D + 128) / 256));
C = (int)MacroPixel->y1 -16;
pixel_2.r = max(0, min(255, (298 * C + 409 * E + 128) / 256));
pixel_2.g = max(0, min(255, (298 * C - 100 * D - 208 * E + 128) / 256));
pixel_2.b = max(0, min(255, (298 * C + 516 * D + 128) / 256));
pF->GetPixel(i * 2, j) = pixel_1;
pF->GetPixel((i * 2) + 1, j) = pixel_2;
/*LummaGray.r = LummaGray.g = LummaGray.b = pRow->y0;
pF->GetPixel(i * 2, j) = LummaGray;
LummaGray.r = LummaGray.g = LummaGray.b = pRow->y1;
pF->GetPixel((i * 2)+1, j) = LummaGray;*/
//pRow++;
}
}
Push(pF);
}
}
return S_OK;
}
示例11: if
void PhysicsFrameSplineEditor::addControlPoint() {
if (m_spline.control.size() == 0) {
m_spline.append(CFrame());
} else if (m_spline.control.size() == 1) {
// Adding the 2nd point
CFrame f = m_spline.control.last();
f.translation += f.lookVector();
m_spline.append(f);
resizeControlPointDropDown(m_spline.control.size());
// Select the new point
setSelectedControlPointIndex(m_selectedControlPointIndex + 1);
} else {
// Adding between two points
float t0 = m_spline.time[m_selectedControlPointIndex];
float newT = t0;
float evalT = 0;
if (m_selectedControlPointIndex < m_spline.control.size() - 1) {
// Normal interval
newT = m_spline.time[m_selectedControlPointIndex + 1];
evalT = (t0 + newT) / 2;
} else if (m_spline.extrapolationMode == SplineExtrapolationMode::CYCLIC) {
// After the end on a cyclic spline
newT = m_spline.getFinalInterval() + t0;
evalT = (t0 + newT) / 2;
} else {
// After the end on a non-cyclic spline of length at least
// 2; assume that we want to step the distance of the previous
// interval
newT = evalT = 2.0f * t0 - m_spline.time[m_selectedControlPointIndex - 1];
}
const PhysicsFrame f = m_spline.evaluate(evalT);
m_spline.control.insert(m_selectedControlPointIndex + 1, f);
m_spline.time.insert(m_selectedControlPointIndex + 1, newT);
// Select the new point
resizeControlPointDropDown(m_spline.control.size());
setSelectedControlPointIndex(m_selectedControlPointIndex + 1);
// Fix the rest of the times to be offset by the inserted duration
float shift = newT - t0;
for (int i = m_selectedControlPointIndex + 1; i < m_spline.time.size(); ++i) {
m_spline.time[i] += shift;
}
}
}
示例12: DetectNewSubshot
HRESULT CSabOnlineSubshotDetectorImp::DetectNewSubshot(CFrame & frame)
{
m_FrameId = frame.Id();
if ( m_SubshotIdx < (m_SubshotList.Size()-1) && !m_IsInSubshot )
{
m_SubshotIdx++;
m_BgnFrameId = m_SubshotList[m_SubshotIdx].BeginFrameId();
m_EndFrameId = m_SubshotList[m_SubshotIdx].EndFrameId();
}
if ( m_FrameId <= m_BgnFrameId )
{
// We have get the next sub shot, but frame is not arrived the bgn frame of the sub shot
// Example: sub shot(bgnFrameId, endFrameId): 1 (1, 10) 2(15, 20)
// If we arrive frame 11, we have entered the subshot 2, but we need to set the flag
m_IsInSubshot = true;
}
if ( m_FrameId == m_BgnFrameId )
{
m_SubshotList[m_SubshotIdx].BeginTime(frame.BeginTime());
m_IsSubshotStart = true;
}
m_KeyframeExtractor->OnNewFrame(frame, m_IsSubshotStart);
//we get a new sub shot
if ( m_FrameId == m_EndFrameId )
{
m_IsInSubshot = false;
m_IsSubshotStart = false;
m_SubshotList[m_SubshotIdx].EndTime(frame.EndTime());
//extract the key frame for current sub shot
//add the last frame
m_KeyframeExtractor->OnNewFrame(frame, true);
CFrameList & keyframeList = m_KeyframeExtractor->OnNewSegment(m_SubshotList[m_SubshotIdx]);
int size = keyframeList.Size();
for( int i = 0; i < size; ++i )
m_SubshotList[m_SubshotIdx].AddKeyframe(keyframeList[i]);
return S_OK;
}
return S_FALSE;
}
示例13: GetSegmentNum
unsigned int CFrameJSegmentor::GetSegmentNum(const CFrame & frame)
{
if( frame.Id() != m_FrameId )
DetectSemgment(frame);
return m_SegmentNum;
}
示例14: GetSourceRect
//////////////////////////////////////////////////////////////
// GetCollisionRect
// - return the entity's bounding rectangle
RECT CEntity::GetSourceRect( void ) const
{
RECT rSource = m_pAM->GetCurrentFrame(m_pAnimInfo)->GetSourceRect().GetRECT();
CFrame* currFrame = m_pAM->GetCurrentFrame(m_pAnimInfo);
int width = rSource.right - rSource.left;
int height = rSource.bottom - rSource.top;
RECT bounding;
bounding.left = (LONG)(m_fPosX - currFrame->GetAnchorPointX() - m_pGC->GetPosX() );
bounding.top = (LONG)(m_fPosY - currFrame->GetAnchorPointY() - m_pGC->GetPosY() );
bounding.right = bounding.left + width;
bounding.bottom = bounding.top + height;
return bounding;
}
示例15: size
bool DrawTestEditor::open (void *ptr)
{
AEffGUIEditor::open (ptr);
CRect size (rect.left , rect.top, rect.right, rect.bottom);
CFrame* frame = new CFrame (size, ptr, this);
frame->setBackground (backgroundBitmap);
size.inset (8, 8);
size.top++; // the background bitmap is not correct
size.left++; // the background bitmap is not correct
// CView* testView = new PLinesView (size);
// frame->addView (testView);
setTabView (frame, size, CTabView::kPositionBottom);
tooltipSupport = new CTooltipSupport;
frame->setMouseObserver (tooltipSupport);
// last but not least set the class variable frame to our newly created frame
this->frame = frame;
return true;
}