(7) Develop a CAD program step by step to delete the entity set and selection set.

Source: Internet
Author: User

After you develop a class to operate on the entity and the selection set in the previous step, you can select and delete it easily.

You only need to delete the image from the selection set.

(1) Select

Class cselect: Public ccomand
{
Public:
Cselect ();
Virtual ~ Cselect ();
Public:
Void onlbuttondown (uint nflags, cposition POS );
Void onmousemove (uint nflags, cposition POS );
PRIVATE:
Chandlecg * m_hand;
 
};

 

 

Cselect: cselect ()
{
M_hand = new chandlecg (& g_pdoc-> m_solid, & g_pdoc-> m_select );
}

Void cselect: onlbuttondown (uint nflags, cposition POS)
{
M_hand-> addselect ();
}

Void cselect: onmousemove (uint nflags, cposition POS)
{
CDC * PDC = g_pview-> getdc ();
Float Dis = pick_radiu * (g_pview-> m_scale );
M_hand-> drawselect (PDC, POs, DIS, normal, select );
}

Cselect ::~ Cselect ()
{

Delete m_hand ;//
}

 

 

(2) Cancel Selection

Class cunselect: Public ccomand
{
Public:
Cunselect ();
Virtual ~ Cunselect ();
Public:
Void onlbuttondown (uint nflags, cposition POS );
Void onmousemove (uint nflags, cposition POS );
PRIVATE:
Chandlecg * m_hand;
 
};

 

 

Cunselect: cunselect ()
{
M_hand = new chandlecg (& g_pdoc-> m_select, & g_pdoc-> m_solid );
}

Void cunselect: onlbuttondown (uint nflags, cposition POS)
{
M_hand-> addselect ();
}

Void cunselect: onmousemove (uint nflags, cposition POS)
{
CDC * PDC = g_pview-> getdc ();
Float Dis = pick_radiu * (g_pview-> m_scale );
M_hand-> drawselect (PDC, POs, DIS, select, normal );
G_pview-> releasedc (PDC );
}

Cunselect ::~ Cunselect ()
{

Delete m_hand ;//
}

 

(3) Delete

Class cdelete: Public ccomand
{
Public:
Cdelete ();
Virtual ~ Cdelete ();
Public:
Void onlbuttondown (uint nflags, cposition POS );
Void onmousemove (uint nflags, cposition POS );
PRIVATE:
Chandlecg * m_hand;
 
};

 

 

Cdelete: cdelete ()
{
M_hand = new chandlecg (& g_pdoc-> m_select, & g_pdoc-> m_solid );
}
Void cdelete: onlbuttondown (uint nflags, cposition POS) // Delete and redraw an object
{
CDC * PDC = g_pview-> getdc ();
M_hand-> deletesolid (PDC );
G_pview-> releasedc (PDC );
}

Void cdelete: onmousemove (uint nflags, cposition POS) // mobile monitor the selected entity
{
CDC * PDC = g_pview-> getdc ();
Float Dis = pick_radiu * (g_pview-> m_scale );
M_hand-> drawselect (PDC, POs, DIS, select, normal );
G_pview-> releasedc (PDC );
}

Cdelete ::~ Cdelete ()
{

Delete m_hand ;//
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.