Ignore:
Timestamp:
Mar 8, 2007, 10:38:27 AM (18 years ago)
Author:
vrinside
Message:

added a memeber function for handling application directory in R2FilePath class.
removed all the absolute path of resources in Nv.cpp except for /opt/...
removed test code segment for checking default transfer function data

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/vizservers/nanovis/R2/src/R2FilePath.cpp

    r582 r611  
    2323
    2424        _curDirectory = buff;
     25
    2526}
    2627
     
    5455                else
    5556                {
     57            FILE* f = fopen("/tmp/insoo.txt", "wt");
     58            fprintf(f, "%s\n", (char*) (_curDirectory + R2string(token)));
     59            fprintf(f, "%s\n", (char*) (_curDirectory + R2string(token) + "/"));
     60            fclose(f);
     61
    5662                        if (token[lastIndex] == '/' || token[lastIndex] == '\\')
    5763                        {
     
    100106}
    101107
     108void R2FilePath::setWorkingDirectory(int argc, const char** argv)
     109{
     110    char buff[255];
     111    strcpy(buff, argv[0]);
     112    for (int i = strlen(buff) - 1; i >= 0; --i)
     113    {
     114        if (buff[i] == '\\' || buff[i] == '/')
     115        {
     116            buff[i] = '/';
     117            buff[i + 1] = '\0';
     118            break;
     119        }
     120    }
    102121
     122        _curDirectory = buff;
     123}
     124
Note: See TracChangeset for help on using the changeset viewer.