|
I have a vector of POINTs and I want to draw a curve that undergo(pass over) all that points in my vector. Somebody adviced me to use Bezier...and probably he is right. But using Bezier method the curve bypasses several points in my vector(control points) which is not my purpose.I hope i make myself understood. My knowledge regarding Bezier curves is so weak that I need your help.
Thank you in advance..I promise to rate good answers.
|
|
|
|
|
Daniel Visan wrote:
Thank you in advance..I promise to rate good answers.
*grin* CP ( thankfully ) has no rating system.
Beziers are mapped by specifying control points, but the curve does not pass through those points, it's more like a magnet, pulling the line *twoard* that point, not through it. I can't recall off the top of my head ( no MSDN or books here ) how to draw a line that passes through the points, but I know there is an AngleArc function, or similar, which may help you.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
Christian Graus wrote:
( thankfully ) has no rating system.
We had one for a while, remember?
With John and You racing against each other
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Nish [BusterBoy] wrote:
We had one for a while, remember?
How could I forget ?
Nish [BusterBoy] wrote:
With John and You racing against each other
Actually that was more everyone ( me included ) vs. Michael Martin, who was voting for me.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
Hi!
I want to make a DNS on may computer (e.g. chat1.suza.com) so my client apps don't have to write in the IP every time they want to connect to the server. This is just over LAN.
Do you know how ??
------------------------------
And Christian Graus: Is it ok
if I "steal" your idea with the
name layout (Rickard Andersson)?
------------------------------
©0d3 ©®4©k3® - That's me!
------------------------------
|
|
|
|
|
Rickard Andersson wrote:
And Christian Graus: Is it ok
if I "steal" your idea with the
name layout (Rickard Andersson
Knock yourself out. I'm tempted to encourage you to get rid of the awful ©0d3 ©®4©k3® thing though. Every time I see it, it makes me think you're 12 years old. Just a thought.
Sorry, I don't know the answer to your question.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
Christian Graus wrote:
it makes me think you're 12 years old. Just a thought.
IS THIS AN ENOUGH GOOD SIGNATURE TO PROVE TO YOU THAT I AM NOT A 12 YEARS OLD BOY AND SORRY SO MUCH IF I'M NICE AND ASKING YOU IF THERE IS OKAY IF I DO THE SAME THING THAT YOU PERHAPS DON'T LIKE THAT I DO!!!
--------------------
Suza Computing
Rickard Andersson AND I AM NOT 12 YEARS OLD!!
ICQ: 50302279
--------------------
|
|
|
|
|
Typing in capitals has the same effect.
I am sorry if I offended you, but it's bugged me for a long time, and I thought I'd mention it while I had the opportunity. It's right up there with l33tsp34k IMO.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
Peace then?
By the way, I'm 17 years!
|
|
|
|
|
Rickard Andersson wrote:
Peace then?
Sure
Rickard Andersson wrote:
By the way, I'm 17 years!
Enjoy it while you can - I'm 33.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
Christian Graus wrote:
the awful ©0d3 ©®4©k3® thing hahahahahahahahaha well said
Anyway, if you're looking at a small scale lan, then your best bet is to use hosts files on all your clients.
ie. in c:\winnt\system32\drivers\etc\hosts . The standard hosts file tells you what to do. Put your servers IP and the desired name in a hosts file on each client.
And bob's your uncle.
Jon
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
The compiler will only Inline certain functions which are defined/declared within the class structure.
So is it safe to assume the compiler will ignore inlining functions which have branching or looping or recursion...?
The reason I ask:
My member functions will not Display themselves in Classwized/view or in the auto-tool-tip windows when typing code unless I define/declare within the class structure, but a few functions would really suck if they inlined...there big(ger) and called quite a few times
Please someone tell me I'm right...and If theres a way i can gaurantee(spelling) a function not to inline except for defining it outside the class...?
TIA and again
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
It is up to the compiler to decide which inlineable functions to inline, and you can do little in general to prevent this, except of course define the function outside the class declaration (and without the inline keyword). Even then, the compiler is free to inline some calls when it feels like doing it (eg., in the same compilation unit).
What strikes me is that your class wizard is not able to "see" functions unless defined in line... It shouldn't be so, take a look at some automatically generated member function (which in general are not defined inline) and try to replicate the syntax for your new member functions.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
It's a template class...
When i add functions there delcared/defined within the class
So i can't use this method...tried that already.
Nothing out of the ordinary in the clw file either...so i dunno...probably my crummy computer...needs a reformat.
Really wish there was a NOINLINE keyword...
thanx again
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
I think the only way is to define the method in a separate .cpp file or somethin and put keyword 'inline' before you define the method:
inline void CMyClass::InlineFunc(BOOL bYes)
{
m_bYesOrNo = bYes;
return 0;
}
Have I miss understod you or...
---------------------------------------------
Rickard Andersson, Suza Computing
Speciality: MFC, C++ and very little C# (for the moment)
ICQ: 50302279
---------------------------------------------
Chrisian Graus: Is this perhapas a good enough signature may be?
BECAUSE I WILL KEEP THIS ONE!
|
|
|
|
|
Rickard Andersson wrote:
Chrisian Graus: Is this perhapas a good enough signature may be?
BECAUSE I WILL KEEP THIS ONE!
Looks great to me - it's about time I was mentioned in someines sig again
FWIW it's good to use bool instead of BOOL, which is in fact an int.
Christian
I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
Picture the daffodil. And while you do that, I'll be over here going through your stuff.
|
|
|
|
|
I was hoping for the opposite effect
making functions not inline that usually would Sorta'
class MyClass{
theFunc(){ AfxMessageBox("hey"); }
theFunc2()
{
AfxMessageBox("I don't want this function to INLINE");
m_bFake = FALSE;
}
};
Thanx anyways
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
There's a setting in the C++ tab in the optimizations category that allows three settings - disable, only inline those explicitly marked 'inline' (believe the cl'er can pass final judgement here, but should warn), and 'hey Ms compiler, you're so good at this stuff, why don't you decide what to inline'.
Would that help - or is it really a template related issue - post some code?
|
|
|
|
|
As Jimi and Joaquín M López Muñoz say: you can do nothing except declare them correctly and let the compiler do its job according to your wishes (read /options).
Besides of this you should ask yourself another question: if the compiler thinks that a function may be inlined, why you think it should not?
Dont tell me that the function may be too big. The argument "the resulting code will be too big" is nonsense nowadays. Applications can expect "sufficient" memory to run almost any code.
So? What is left? Speed? If it gets called so many times, the compiler is right - it preserves lot of overhead for the function call and execution.
Anything else that I missed?
|
|
|
|
|
Andreas Saurwein wrote:
Besides of this you should ask yourself another question: if the compiler thinks that a function may be inlined, why you think it should not?
I always thought it was good practice to only inline those functions which were relatively small(a few push, mov and pop, ret)
My question was that i'm aware the compiler will implicity inline functions defined and declared in the class itself, but only under certain circumstances(NOT recursion, etc...)
Is there a way i can avoid this gauranteed!!!
3 member functions dec/defined in the class itself I feel are far to large to inline.
1) 500 bytes total( 51 prolog, 26 epilog) so i'd save 77 bytes if I inlined, but I'd have additional 423 bytes * already 9 function calls = 3807 bytes which could be avoided if the function didn't inline.
So under most circumstances I agree it's best to leave the compiler to do it's job, but this is an extenuating circumstance(I think).
I was unsure if the compiler would INLINE this function of mine, because it's a template class and all the functions have to dec/defined within the class(or they won't show in ClassView...? )
I suppose i could have looked at the disassembly and determined if it was calling or inlining??? But i'm too lazy;P
Andreas Saurwein wrote:
Dont tell me that the function may be too big. The argument "the resulting code will be too big" is nonsense nowadays. Applications can expect "sufficient" memory to run almost any code.
Most certainly they can, with virtual memory and all(however i'm running a 266,Win98 32 MB RAM, which I find slow). However I feel this goes against what C/C++ stand for. According to(I think is the original "C Programming Language" By Kernighan&Rithchie) C is a relatively low-level language, so I'll assume C++ just follows suit, except better type checking, implementation hiding, etc...both support pointers and inline _asm
So if i didn't wanna worry about code execution and size I'd probably go back to VB...instead I find myself leaning more towards assembly
Have a day!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
You can use #pragma auto_inline( [{on | off}] ) , or compiler options /Ob
I vote pro drink
|
|
|
|
|
The pragma is much preferd
Could I not use function and intrinsic to accomplish the same thing...?
Thanx again
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Does the following seem appropriate...?
Type* temp = m_pBuff;
try{
m_pBuff = (Type*)HeapReAlloc(m_hHeap, HEAP_ALLOC, m_pBuff, nHeapSize);
}
catch(...){
bFull = TRUE;
m_pBuff = temp;
}
Any suggestions?
TIA
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
As it stands, HeapReAlloc does not throw any exception (it returns NULL on failure), so your exception handler will never be called. You can add the flag HEAP_GENERATE_EXCEPTIONS to indicate HeapReAlloc to throw on exception if it fails, but even so the technique is probably more expensive (in computational terms) than the simpler check against NULL (IMHO).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
HEAP_ALLOC macro actually expands
HEAP_NO_SERIALIZE | HEAP_GENERATE_EXCEPTIONS | HEAP_ZERO_MEMORY
sorry bout that.
I can't for some reason get HeapAlloc/ReAlloc to return NULL
even if i try it with 2,000,000,000 byte request it succeeds(without GEN_EXCEPTIONS)...but the exception fires, so i dunno...
Other than this...is everything OK...?
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|