ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/objutil.c
(Generate patch)

Comparing ray/src/common/objutil.c (file contents):
Revision 2.6 by greg, Sun Jun 14 03:04:25 2020 UTC vs.
Revision 2.10 by greg, Fri Dec 18 00:15:47 2020 UTC

# Line 460 | Line 460 | findDuplicateFaces(Scene *sc)
460                          ++nfound;
461                  }
462          }
463 +        if (verbose)
464 +                fprintf(stderr, "Found %d duplicate faces\n", nfound);
465          return(nfound);
466   }
467  
# Line 547 | Line 549 | addComment(Scene *sc, const char *comment)
549          sc->descr[sc->ndescr++] = savqstr((char *)comment);
550   }
551  
552 + /* Find index for comment containing the given string (starting from n) */
553 + int
554 + findComment(Scene *sc, const char *match, int n)
555 + {
556 +        if (n >= sc->ndescr)
557 +                return(-1);
558 +        n *= (n > 0);
559 +        while (n < sc->ndescr)
560 +                if (strstr(sc->descr[n], match) != NULL)
561 +                        return(n);
562 +        return(-1);
563 + }
564 +
565   /* Clear comments */
566   void
567   clearComments(Scene *sc)
# Line 760 | Line 775 | dupScene(const Scene *osc)
775          return(sc);
776   }
777  
778 + #define MAXAC   100
779 +
780   /* Transform entire scene */
781   int
782   xfScene(Scene *sc, int xac, char *xav[])
783   {
784 +        char    comm[24+MAXAC*8];
785 +        char    *cp;
786          XF      myxf;
787          FVECT   vec;
788          int     i;
# Line 786 | Line 805 | xfScene(Scene *sc, int xac, char *xav[])
805                  vec[0] /= myxf.sca; vec[1] /= myxf.sca; vec[2] /= myxf.sca;
806                  VCOPY(sc->norm[i], vec);
807          }
808 +                                        /* add comment */
809 +        cp = strcpy(comm, "Transformed by:");
810 +        for (i = 0; i < xac; i++) {
811 +                while (*cp) cp++;
812 +                *cp++ = ' ';
813 +                strcpy(cp, xav[i]);
814 +        }
815 +        addComment(sc, comm);
816          return(xac);                    /* all done */
817   }
818  
819   /* Ditto, using transform string rather than pre-parsed words */
793 #define MAXAC   100
820   int
821   xfmScene(Scene *sc, const char *xfm)
822   {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines