本文整理汇总了C++中Gate::set_Coord_From_outC方法的典型用法代码示例。如果您正苦于以下问题:C++ Gate::set_Coord_From_outC方法的具体用法?C++ Gate::set_Coord_From_outC怎么用?C++ Gate::set_Coord_From_outC使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gate
的用法示例。
在下文中一共展示了Gate::set_Coord_From_outC方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnLButtonDown
//.........这里部分代码省略.........
if (pDoc->isSelected) {
pDoc->locked = TRUE;
if (pDoc->objectType == GATE_TYPE)
{
Gate *Gtemp;
Gtemp = NULL;
switch (pDoc->objectName)
{
case AND_GATE:
Gtemp = new andGate(dec_x, dec_y);
break;
case OR_GATE:
Gtemp = new orGate(dec_x, dec_y);
break;
case NAND_GATE:
Gtemp = new nandGate(dec_x, dec_y);
break;
case NOR_GATE:
Gtemp = new norGate(dec_x, dec_y);
break;
case XOR_GATE:
Gtemp = new xorGate(dec_x, dec_y);
break;
case NOT_GATE:
Gtemp = new notGate(dec_x, dec_y);
break;
}
temp = Gtemp; // delete ¿ëÀ¸·Î ÇÊ¿äÇÔ.
if (Gtemp != NULL) {
Gtemp->set_Coord_From_outC(dec_x, dec_y);
pDoc->currBox->logicInfo.push_back(Gtemp);
pDoc->CheckPoint();
}
}
else if (pDoc->objectType == WIRING_TYPE)
{
Pin *Ptemp = NULL;
Clock *Ctemp = NULL;
Out *Otemp = NULL;
Sevenseg *Stemp = NULL;
temp = NULL;
switch (pDoc->objectName)
{
case PIN:
Ptemp = new Pin(dec_x, dec_y);
temp = Ptemp;
//¶óÀ̺귯¸® »óÀÚ¿¡ ´ëÇÑ ÀÔ·Â À§Ä¡¸¦ ã¾ÆÁØ´Ù.
break;
case CLOCK:
Ctemp = new Clock(dec_x, dec_y);
temp = Ctemp;
break;
case OUTPIN:
Otemp = new Out(dec_x, dec_y);
temp = Otemp;
break;
case SEG7:
示例2: OnEditPaste
void CCircuitView::OnEditPaste()
{
if (PASTED || CUTED) {
CLogicSimulatorDoc *pDoc = (CLogicSimulatorDoc *)GetDocument();
for (int i = 0; i < pDoc->currBox->store.name.size(); i++)
{
LogicObject* temp;
int dec_x = pDoc->currBox->store.dec.x, dec_y = pDoc->currBox->store.dec.y;
if (pDoc->currBox->store.type.at(i) == GATE_TYPE)
{
Gate *Gtemp;
Gtemp = NULL;
switch (pDoc->currBox->store.name.at(i))
{
case AND_GATE:
Gtemp = new andGate(dec_x, dec_y);
break;
case OR_GATE:
Gtemp = new orGate(dec_x, dec_y);
break;
case NAND_GATE:
Gtemp = new nandGate(dec_x, dec_y);
break;
case NOR_GATE:
Gtemp = new norGate(dec_x, dec_y);
break;
case XOR_GATE:
Gtemp = new xorGate(dec_x, dec_y);
break;
case NOT_GATE:
Gtemp = new notGate(dec_x, dec_y);
break;
}
temp = Gtemp; // delete ¿ëÀ¸·Î ÇÊ¿äÇÔ.
if (Gtemp != NULL) {
Gtemp->set_Coord_From_outC(dec_x, dec_y);
}
}
else if (pDoc->currBox->store.type.at(i) == WIRING_TYPE)
{
Pin *Ptemp = NULL;
Clock *Ctemp = NULL;
Out *Otemp = NULL;
Sevenseg *Stemp = NULL;
temp = NULL;
switch (pDoc->currBox->store.name.at(i))
{
case PIN:
Ptemp = new Pin(dec_x, dec_y);
temp = Ptemp;
//¶óÀ̺귯¸® »óÀÚ¿¡ ´ëÇÑ ÀÔ·Â À§Ä¡¸¦ ã¾ÆÁØ´Ù.
break;
case CLOCK:
Ctemp = new Clock(dec_x, dec_y);
temp = Ctemp;
break;
case OUTPIN:
Otemp = new Out(dec_x, dec_y);
temp = Otemp;
break;
case SEG7:
Stemp = new Sevenseg(dec_x, dec_y);
temp = Stemp;
}
if (temp != NULL) {
temp->set_outputCoord(dec_x, dec_y);
temp->set_Coord_From_outC(dec_x, dec_y);
//Ãâ·ÂÇÉÀº Ãâ·Â ¼±ÀÌ ¾ø´Ù.
//7 segµµ ¸¶Âù°¡ÁöÀÓ.
}
}
else if (pDoc->currBox->store.type.at(i) == FLIPFLOP_TYPE)
{
FlipFlop *Ftemp = NULL;
switch (pDoc->currBox->store.name.at(i))
{
case D_FF:
Ftemp = new DFlipFlop(dec_x, dec_y);
break;
case JK_FF:
Ftemp = new JKFlipFlop(dec_x, dec_y);
break;
case T_FF:
Ftemp = new TFlipFlop(dec_x, dec_y);
break;
//.........这里部分代码省略.........