您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetShape函数代码示例

51自学网 2021-06-01 21:15:00
  C++
这篇教程C++ GetShape函数代码示例写得很实用,希望能帮到您。

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

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

示例1: WXUNUSED

void MyEvtHandler::OnDragRight(bool WXUNUSED(draw), double x, double y, int WXUNUSED(keys), int attachment){  // Force attachment to be zero for now  attachment = 0;  wxClientDC dc(GetShape()->GetCanvas());  GetShape()->GetCanvas()->PrepareDC(dc);  wxPen dottedPen(*wxBLACK, 1, wxDOT);  dc.SetLogicalFunction(OGLRBLF);  dc.SetPen(dottedPen);  double xp, yp;  GetShape()->GetAttachmentPosition(attachment, &xp, &yp);  dc.DrawLine((long) xp, (long) yp, (long) x, (long) y);}
开发者ID:gitrider,项目名称:wxsj2,代码行数:15,


示例2: GetShape

// Returns true if the unichar sets are equal between the shapes.bool ShapeTable::EqualUnichars(int shape_id1, int shape_id2) const {  const Shape& shape1 = GetShape(shape_id1);  const Shape& shape2 = GetShape(shape_id2);  for (int c1 = 0; c1 < shape1.size(); ++c1) {    int unichar_id1 = shape1[c1].unichar_id;    if (!shape2.ContainsUnichar(unichar_id1))      return false;  }  for (int c2 = 0; c2 < shape2.size(); ++c2) {    int unichar_id2 = shape2[c2].unichar_id;    if (!shape1.ContainsUnichar(unichar_id2))      return false;  }  return true;}
开发者ID:Using1174,项目名称:tesseract,代码行数:16,


示例3: ShapePos

/* * Function BuildPadShapePolygon * Build the Corner list of the polygonal shape, * depending on shape, extra size (clearance ...) pad and orientation * Note: for Round and oval pads this function is equivalent to * TransformShapeWithClearanceToPolygon, but not for other shapes */void D_PAD::BuildPadShapePolygon( SHAPE_POLY_SET& aCornerBuffer,                                  wxSize aInflateValue, int aSegmentsPerCircle,                                  double aCorrectionFactor ) const{    wxPoint corners[4];    wxPoint PadShapePos = ShapePos();         /* Note: for pad having a shape offset,                                                     * the pad position is NOT the shape position */    switch( GetShape() )    {    case PAD_SHAPE_CIRCLE:    case PAD_SHAPE_OVAL:        TransformShapeWithClearanceToPolygon( aCornerBuffer, aInflateValue.x,                                              aSegmentsPerCircle, aCorrectionFactor );        break;    case PAD_SHAPE_TRAPEZOID:    case PAD_SHAPE_RECT:        aCornerBuffer.NewOutline();        BuildPadPolygon( corners, aInflateValue, m_Orient );        for( int ii = 0; ii < 4; ii++ )        {            corners[ii] += PadShapePos;          // Shift origin to position            aCornerBuffer.Append( corners[ii].x, corners[ii].y );        }        break;    }}
开发者ID:corecode,项目名称:kicad-source-mirror,代码行数:36,


示例4: FixPosWithShape

void LRSeparateComplex::FixPosWithShape(sm::vec2& pos, const std::string& filepath) const{	std::string path = filepath.substr(0, filepath.find_last_of('.')) + "_shape.json";	std::string shape_path = m_dir + "//" + m_point_dir + "//" + path;	if (!ee::FileHelper::IsFileExist(shape_path)) {		return;	}	auto sym = ee::SymbolMgr::Instance()->FetchSymbol(shape_path);	auto shape_symbol = std::dynamic_pointer_cast<eshape::Symbol>(sym);	if (!shape_symbol) {		throw ee::Exception("shape file err:%s", filepath);	}		auto shape = shape_symbol->GetShape();	if (!shape) {		throw ee::Exception("shape file empty:%s", filepath);	}	if (auto point = std::dynamic_pointer_cast<eshape::PointShape>(shape)) {		pos += point->GetPos();	} else {		throw ee::Exception("shape file is not point:%s", filepath);	}}
开发者ID:xzrunner,项目名称:easyeditor,代码行数:25,


示例5: GetShape

LAYER_MSK TRACK::GetLayerMask() const{    if( Type() == PCB_VIA_T )    {        int via_type = GetShape();        if( via_type == VIA_THROUGH )            return ALL_CU_LAYERS;        // VIA_BLIND_BURIED or VIA_MICRVIA:        LAYER_NUM bottom_layer, top_layer;        // LayerPair() knows how layers are stored        ( (SEGVIA*) this )->LayerPair( &top_layer, &bottom_layer );        LAYER_MSK layermask = NO_LAYERS;        while( bottom_layer <= top_layer )        {            layermask |= ::GetLayerMask( bottom_layer );            ++bottom_layer;        }        return layermask;    }    else    {        return ::GetLayerMask( m_Layer );    }}
开发者ID:Th0rN13,项目名称:kicad-source-mirror,代码行数:31,


示例6: WXUNUSED

void MyEvtHandler::OnEndDragRight(double x, double y, int WXUNUSED(keys), int WXUNUSED(attachment)){  GetShape()->GetCanvas()->ReleaseMouse();  MyCanvas *canvas = (MyCanvas *)GetShape()->GetCanvas();  // Check if we're on an object  int new_attachment;  wxShape *otherShape = canvas->FindFirstSensitiveShape(x, y, &new_attachment, OP_DRAG_RIGHT);  if (otherShape && !otherShape->IsKindOf(CLASSINFO(wxLineShape)))  {    canvas->view->GetDocument()->GetCommandProcessor()->Submit(      new DiagramCommand(_T("wxLineShape"), OGLEDIT_ADD_LINE, (DiagramDocument *)canvas->view->GetDocument(), CLASSINFO(wxLineShape),      0.0, 0.0, false, NULL, GetShape(), otherShape));  }}
开发者ID:BackupTheBerlios,项目名称:wxbeos-svn,代码行数:16,


示例7: switch

int D_PAD::boundingRadius() const{    int x, y;    int radius;    switch( GetShape() )    {    case PAD_SHAPE_CIRCLE:        radius = m_Size.x / 2;        break;    case PAD_SHAPE_OVAL:        radius = std::max( m_Size.x, m_Size.y ) / 2;        break;    case PAD_SHAPE_RECT:        radius = 1 + KiROUND( EuclideanNorm( m_Size ) / 2 );        break;    case PAD_SHAPE_TRAPEZOID:        x = m_Size.x + std::abs( m_DeltaSize.y );   // Remember: m_DeltaSize.y is the m_Size.x change        y = m_Size.y + std::abs( m_DeltaSize.x );   // Remember: m_DeltaSize.x is the m_Size.y change        radius = 1 + KiROUND( hypot( x, y ) / 2 );        break;    default:        radius = 0;    }    return radius;}
开发者ID:corecode,项目名称:kicad-source-mirror,代码行数:31,


示例8: Spawn

void FollowHub::Update(){    _timer++;    if ( _timer > ( _powerA ? TIMER / 2 : TIMER ) ) {        _timer = 0;        _count++;        if ( IsOnScreen() ) {            if ( _powerB )                Spawn( new Chaser( GetPosition() ) );            else                Spawn( new Follow( GetPosition() ) );            PlaySoundRandom( Lib::SOUND_ENEMY_SPAWN );        }    }    if ( GetPosition()._x < 0 )        _dir.Set( 1, 0 );    else if ( GetPosition()._x > Lib::WIDTH )        _dir.Set( -1, 0 );    else if ( GetPosition()._y < 0 )        _dir.Set( 0, 1 );    else if ( GetPosition()._y > Lib::HEIGHT )        _dir.Set( 0, -1 );    else if ( _count > 3 ) {        _dir.Rotate( -M_PI / M_TWO );        _count = 0;    }    fixed s = _powerA ? M_PT_ZERO_ONE * 5 + M_PT_ONE : M_PT_ZERO_ONE * 5;    Rotate( s );    GetShape( 0 ).Rotate( -s );    Move( _dir * SPEED );}
开发者ID:grandseiken,项目名称:iispace,代码行数:34,


示例9: GetShape

// Merges shapes with a common unichar over the [start, end) interval.// Assumes single unichar per shape.void ShapeTable::ForceFontMerges(int start, int end) {  for (int s1 = start; s1 < end; ++s1) {    if (MasterDestinationIndex(s1) == s1 && GetShape(s1).size() == 1) {      int unichar_id = GetShape(s1)[0].unichar_id;      for (int s2 = s1 + 1; s2 < end; ++s2) {        if (MasterDestinationIndex(s2) == s2 && GetShape(s2).size() == 1 &&            unichar_id == GetShape(s2)[0].unichar_id) {          MergeShapes(s1, s2);        }      }    }  }  ShapeTable compacted(*unicharset_);  compacted.AppendMasterShapes(*this);  *this = compacted;}
开发者ID:0xkasun,项目名称:Dummy_Tes,代码行数:18,


示例10: Collider2D

    RigidBody2D::RigidBody2D(const RigidBody2D& other, Object& newObj)        : Collider2D(other, newObj)    {        b2BodyDef bd;        b2FixtureDef fdf;        auto& pos = getObject()->getGlobalPosition();        bd.angle = glm::eulerAngles(getObject()->getGlobalRotation()).z;        bd.position = b2Vec2(pos.x, pos.y);        bd.userData = this;        auto om = other.m_body;        bd.type = om->GetType();        newObj.setIgnoreParent(other.getObject()->ignoresParent());        fdf.isSensor = om->GetFixtureList()->IsSensor();        bd.allowSleep = om->IsSleepingAllowed();        m_body = other.m_worldRef2D.m_worldData2D->CreateBody(&bd);        auto omf = om->GetFixtureList();        fdf.filter = omf->GetFilterData();        fdf.friction = omf->GetFriction();        fdf.restitution = omf->GetRestitution();        fdf.shape = omf->GetShape();        fdf.density = omf->GetDensity();        m_body->CreateFixture(&fdf);    }
开发者ID:Jopnal,项目名称:Jopnal,代码行数:31,


示例11: switch

wxString D_PAD::ShowPadShape() const{    switch( GetShape() )    {    case PAD_SHAPE_CIRCLE:        return _( "Circle" );    case PAD_SHAPE_OVAL:        return _( "Oval" );    case PAD_SHAPE_RECT:        return _( "Rect" );    case PAD_SHAPE_TRAPEZOID:        return _( "Trap" );    case PAD_SHAPE_ROUNDRECT:        return _( "Roundrect" );    case PAD_SHAPE_CUSTOM:        return _( "CustomShape" );    default:        return wxT( "???" );    }}
开发者ID:cpavlina,项目名称:kicad,代码行数:26,


示例12: switch

int D_PAD::boundingRadius() const{    int x, y;    int radius;    switch( GetShape() )    {    case PAD_CIRCLE:        radius = m_Size.x / 2;        break;    case PAD_OVAL:        radius = std::max( m_Size.x, m_Size.y ) / 2;        break;    case PAD_RECT:        radius = 1 + (int) ( sqrt( (double) m_Size.y * m_Size.y                                 + (double) m_Size.x * m_Size.x ) / 2 );        break;    case PAD_TRAPEZOID:        x = m_Size.x + std::abs( m_DeltaSize.y );   // Remember: m_DeltaSize.y is the m_Size.x change        y = m_Size.y + std::abs( m_DeltaSize.x );   // Remember: m_DeltaSize.x is the m_Size.y change        radius = 1 + (int) ( sqrt( (double) y * y + (double) x * x ) / 2 );        break;    default:        radius = 0;    }    return radius;}
开发者ID:james-sakalaukus,项目名称:kicad,代码行数:32,


示例13: STRING

// Returns a string listing the classes/fonts in a shape.STRING ShapeTable::DebugStr(int shape_id) const {  if (shape_id < 0 || shape_id >= shape_table_.size())    return STRING("INVALID_UNICHAR_ID");  const Shape& shape = GetShape(shape_id);  STRING result;  result.add_str_int("Shape", shape_id);  if (shape.size() > 100) {    result.add_str_int(" Num unichars=", shape.size());    return result;  }  for (int c = 0; c < shape.size(); ++c) {    result.add_str_int(" c_id=", shape[c].unichar_id);    result += "=";    result += unicharset_->id_to_unichar(shape[c].unichar_id);    if (shape.size() < 10) {      result.add_str_int(", ", shape[c].font_ids.size());      result += " fonts =";      int num_fonts = shape[c].font_ids.size();      if (num_fonts > 10) {        result.add_str_int(" ", shape[c].font_ids[0]);        result.add_str_int(" ... ", shape[c].font_ids[num_fonts - 1]);      } else {        for (int f = 0; f < num_fonts; ++f) {          result.add_str_int(" ", shape[c].font_ids[f]);        }      }    }  }  return result;}
开发者ID:0xkasun,项目名称:Dummy_Tes,代码行数:31,


示例14: NumShapes

// Returns true if any shape contains multiple unichars.bool ShapeTable::AnyMultipleUnichars() const {  int num_shapes = NumShapes();  for (int s1 = 0; s1 < num_shapes; ++s1) {    if (MasterDestinationIndex(s1) != s1) continue;    if (GetShape(s1).size() > 1)      return true;  }  return false;}
开发者ID:0xkasun,项目名称:Dummy_Tes,代码行数:10,


示例15: GetShape

void Cursor::Show (void) {  if (x-1>=0 || y-1>=0 || x-1+sizex<320 || y-1+sizey<200)    GetShape (x-1,y-1,sizex,sizey,buffer);  PutPixel (x,y+1,15);  PutPixel (x,y-1,15);  PutPixel (x+1,y,15);  PutPixel (x-1,y,15);  visible=1;}
开发者ID:TimofonicJunkRoom,项目名称:Oldies,代码行数:9,


示例16: MasterDestinationIndex

// Returns the sum of the font counts in the master shape.int ShapeTable::MasterFontCount(int shape_id) const {  int master_id = MasterDestinationIndex(shape_id);  const Shape& shape = GetShape(master_id);  int font_count = 0;  for (int c = 0; c < shape.size(); ++c) {    font_count += shape[c].font_ids.size();  }  return font_count;}
开发者ID:0xkasun,项目名称:Dummy_Tes,代码行数:10,


示例17: if

int Clef::GetClefLocOffset() const{    int offset = 0;    if (GetShape() == CLEFSHAPE_G)        offset = -4;    else if (GetShape() == CLEFSHAPE_F)        offset = 4;    offset += (GetLine() - 1) * 2;    int disPlace = 0;    if (GetDisPlace() == PLACE_above)        disPlace = -1;    else if (GetDisPlace() == PLACE_below)        disPlace = 1;    if ((disPlace != 0) && (GetDis() != OCTAVE_DIS_NONE)) offset += (disPlace * (GetDis() - 1));    return offset;}
开发者ID:DDMAL,项目名称:verovio,代码行数:20,


示例18: GetShape

void __fastcall TOrgChartRLMainForm::dxDBOrgChartCreateNode(TObject *Sender,	  TdxOcNode *Node){	if (Table1->FindField("width")->AsInteger > 50)	  Node->Width = Table1->FindField("width")->AsInteger;	if (Table1->FindField("height")->AsInteger > 50)	  Node->Height = Table1->FindField("height")->AsInteger;	Node->Shape = GetShape(Table1->FindField("type")->AsString);	Node->Color = (TColor)Table1->FindField("color")->AsInteger;	Node->ImageAlign = GetImageAlign(Table1->FindField("ImageAlign")->AsString);}
开发者ID:chinnyannieb,项目名称:Meus-Projetos,代码行数:11,


示例19: GetShape

void WeibullDistribution::SetParameters(double mean, double cov){ Distribution::SetParameters(mean, cov); double vShape = GetShape(cov); double vScale = mean / boost::math::tgamma(1 + 1 / vShape) ; _wblObject = weibull_distribution<>(vShape, vScale); _name = "Wbl";}
开发者ID:tims-corbett,项目名称:BoostTest,代码行数:11,


示例20: GetShape

void CNodeLocations::InsertNode(const void* apObject,                                EObjectShapes aObjectShape,                                const std::vector<wxPoint>& arCoords){        CShapeLocation* pShape = GetShape(aObjectShape, arCoords);        if (pShape)        {                CShapeLocationPtr pBox(pShape);                mNodeLocations.insert(std::make_pair(apObject, pBox));        }}
开发者ID:martsbradley,项目名称:sumtree,代码行数:12,


示例21: GetShape

// Calculate what new size would be, at end of resizevoid wxPolygonControlPoint::CalculateNewSize(double x, double y){	double bound_x;	double bound_y;	GetShape()->GetBoundingBoxMin(&bound_x, &bound_y);	double dist = (double)sqrt((x - m_shape->GetX()) * (x - m_shape->GetX()) +	                           (y - m_shape->GetY()) * (y - m_shape->GetY()));	m_newSize.x = (double)(dist / this->m_originalDistance) * this->m_originalSize.x;	m_newSize.y = (double)(dist / this->m_originalDistance) * this->m_originalSize.y;}
开发者ID:kleopatra999,项目名称:pgadmin3,代码行数:13,


示例22: matchBodiesToRings

std::vector<match_t> matchBodiesToRings(It begin, It end){	std::vector<match_t> batch;	std::transform(begin, end, std::back_inserter(batch), [](b2Body* body)	{		auto f = body->GetFixtureList();		auto shape = static_cast<b2ChainShape*>(f->GetShape());		return std::make_pair(body, convertShape(body->GetWorldCenter(), shape));	});	return batch;}
开发者ID:ZhangYunjie,项目名称:DestructibleBox2D,代码行数:13,


示例23: SetLayerPair

void SEGVIA::SetLayerPair( LAYER_NUM top_layer, LAYER_NUM bottom_layer ){    if( GetShape() == VIA_THROUGH )    {        top_layer    = LAYER_N_FRONT;        bottom_layer = LAYER_N_BACK;    }    if( bottom_layer > top_layer )        EXCHG( bottom_layer, top_layer );    // XXX EVIL usage of LAYER    m_Layer = (top_layer & 15) + ( (bottom_layer & 15) << 4 );}
开发者ID:Th0rN13,项目名称:kicad-source-mirror,代码行数:14,


示例24: LayerPair

void SEGVIA::LayerPair( LAYER_NUM* top_layer, LAYER_NUM* bottom_layer ) const{    LAYER_NUM b_layer = LAYER_N_BACK;    LAYER_NUM t_layer = LAYER_N_FRONT;    if( GetShape() != VIA_THROUGH )    {        // XXX EVIL usage of LAYER        b_layer = (m_Layer >> 4) & 15;        t_layer = m_Layer & 15;        if( b_layer > t_layer )            EXCHG( b_layer, t_layer );    }
开发者ID:Th0rN13,项目名称:kicad-source-mirror,代码行数:14,



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


C++ GetSimContext函数代码示例
C++ GetSetMediaTrackInfo函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。